更改codeigniters日历模板

时间:2013-01-23 10:17:12

标签: php codeigniter codeigniter-2

我正在使用代码点火器构建Web应用程序,我在自定义日历模板时遇到问题。我使用代码点火器的日历库

构建日历

enter image description here

现在我想要更改模板,以便日期列出如下


1

2

3

..等等

而不是


1 2 3


4 5 6


任何人都可以告诉我如何做到这一点

1 个答案:

答案 0 :(得分:1)

取自:http://ellislab.com/codeigniter/user-guide/libraries/calendar.html

通过创建日历模板,您可以100%控制日历的设计。您日历的每个组件都将放在一对伪变量中,如下所示:

  

$ prefs ['template'] ='

     

{table_open} {/ table_open}

     

{heading_row_start} {/ heading_row_start}

     

{heading_previous_cell}<< {/ heading_previous_cell}
  {heading_title_cell} {标题} {/ heading_title_cell}
  {heading_next_cell}>> {/ heading_next_cell}

     

{heading_row_end} {/ heading_row_end}

     

{week_row_start} {/ week_row_start}
  {week_day_cell} {WEEK_DAY} {/ week_day_cell}
  {week_row_end} {/ week_row_end}

     

{cal_row_start} {/ cal_row_start}
  {cal_cell_start} {/ cal_cell_start}

     

{cal_cell_content} {天} {/ cal_cell_content}   {cal_cell_content_today} {天} {/ cal_cell_content_today}

     

{cal_cell_no_content} {天} {/ cal_cell_no_content}
  {cal_cell_no_content_today} {天} {/ cal_cell_no_content_today}

     

{cal_cell_blank} {/ cal_cell_blank}

     

{cal_cell_end} {/ cal_cell_end}
  {cal_row_end} {/ cal_row_end}

     

{table_close} {/ table_close}';

     

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

     

echo $ this-> calendar-> generate();

因此,您必须使用不同的HTML和/或CSS更改设计。