用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2310|回复: 2
收起左侧

日历类如何生成所有天都带链接

[复制链接]
发表于 2013-2-26 13:41:46 | 显示全部楼层 |阅读模式
这是正常情况下输一个日历,其中1,2,3号带有链接
$data = array(
1 => 'http://localhost/calendar/1',
2 => 'http://localhost/calendar/2',
3 => 'http://localhost/calendar/3',
);

$this->load->library('calendar');

echo $this->calendar->generate(2013,2,$data);

现在我想通过一个循环让所有一个月的所有天数都带有链接?要怎么做呢!

就像一些博客一样,点击日历的某一天就可以显示那天的日志这样?

刚开始学codeigniter,大虾指点一下,谢谢!

发表于 2013-2-27 09:02:21 | 显示全部楼层
关注一下。日历类还没有 使用过呢
发表于 2013-2-27 11:27:30 | 显示全部楼层
$data = array(
11 => 'http://localhost/calendar/2013/02/11',
12 => 'http://localhost/calendar/2013/02/12',
13 => 'http://localhost/calendar/2013/02/13',
);

function calendar(int $year, int $month, int $day)
{
     //将日期转换为时间戳,select数据为当日范围的,展示出来
}



本版积分规则