传数据到单元格 增加数据到日历的单元格就要创建一个关联数组,在这个数组中索引是你想链接的天数value值包含你要传入的值.数组通过日历创建函数的第三个参数被传入. 参考下面这个例子: $date_time = time();
$year = ($this->uri->segment(2) == 'archive') ? $this->uri->segment(3) : date("Y", $date_time);
$month = ($this->uri->segment(2) == 'archive') ? $this->uri->segment(4) : date("m", $date_time);
$data = $this->get_calendar_data($year, $month);
比如返回的data如下
$data = array(
3 => 'http://example.com/news/article/2006/03/',
7 => 'http://example.com/news/article/2006/07/',
13 => 'http://example.com/news/article/2006/13/',
26 => 'http://example.com/news/article/2006/26/'
);$this->load->library('calendar');
echo $this->calendar->generate($year, $month, $data);使用上面的例子,天数3,7,13和26将变成链接指向你提供的URLs. |