I made a method that writes a VIEW with a calendar table that shows all the months of a year using the library Calendaring Class . It works fine, and returns this:
Code:
<?phpclassCalendarextendsCI_Controller{publicfunctionthis_year(){$data['title']='Calendar:'.date('Y');$this->load->library('calendar');$prefs=array('local_time'=>'none','start_day'=>'sunday','month_type'=>'long','day_type'=>'short','show_next_prev'=>FALSE,'show_other_days'=>TRUE,'template'=>'{table_open}<tableclass="table table-condensed">{/table_open}
{heading_row_start}<tr class="info">{/heading_row_start}
{cal_cell_start_today}<td class="today">{/cal_cell_start_today}
{cal_cell_start_other}<td class="other-day">{/cal_cell_start_other}
'
);
$this->load->library('calendar', $prefs);
$data['calendar'] = '<table class="table-calendar"><tr>';
for ($i = 1; $i <= 12; $i++) {
if ($i % 3 == 0) {
$data['calendar'].= "<td>{$this->calendar->generate(date('Y'), $i)}</td>";
$data['calendar'].= '</tr><tr>';
}
else {
$data['calendar'].= "<td>{$this->calendar->generate(date('Y'), $i)}</td>";
}
}
$data['calendar'].= '</tr></table>';
$this->template->load('template/index', __CLASS__ . "/" . __FUNCTION__, $data);
}
}
But I did not find a way to highlight only the current month using a template in the table's CSS. When I change the line style {heading_row_start}<tr>{/heading_row_start}
( ref ), it modifies all the month labels:
I'musingthemethodsandstandardsof basic tutorial code). Any suggestions?