Codeigniter - Добавление событий в определенный класс календаря дат

With this small modification on the file system/libraries/Calendar.php, You will be able to add events on a Specific date in the Calendar Class

example:

               $data = array(

               //year
               '2007' => array(
                                   //month
                                  '08' => array(
                                                //day
                                                 3 => 'http://example.com/news/article/2006/03/'
                                  )
               ),
               //year
               '2008' => array(
                                   //month
                                  '01' => array(
                                                //day
                                                 8 => 'http://example.com/news/article/2006/03/'
                                  )
               )

             );

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

if you have your own modifications on the file system/libraries/Calendar.php you can just look for this part :

                    if (isset($data[$day]))
                    {
                        // Cells with content
                        $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
                        $out .= str_replace('{day}', $day, str_replace('{content}', $data[$day], $temp));
                    }
                    else
                    {
                        // Cells with no content
                        $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content'];
                        $out .= str_replace('{day}', $day, $temp);
                    }

and Replace it with :

                    if (isset($data[$year][$month][$day]))
                    {
                        // Cells with content
                        $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
                        $out .= str_replace('{day}', $day, str_replace('{content}', $data[$year][$month][$day], $temp));
                    }
                    else
                    {
                        // Cells with no content
                        $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content'];
                        $out .= str_replace('{day}', $day, $temp);
                    }