コード例 #1
0
 /**
  * view method
  *
  * @access public
  * @return void
  * @author ida
  */
 public function view()
 {
     if (empty($this->year) || !is_int($this->year)) {
         $this->year = date('Y');
     }
     if (strlen($this->year) < 4 and $this->year) {
         $this->year = (int) str_pad($this->year, 4, 0, STR_PAD_RIGHT);
     }
     if (strlen($this->year) > 4 and $this->year) {
         $this->year = (int) substr($this->year, 0, 4);
     }
     if (empty($this->month) || !is_int($this->month)) {
         $this->month = date('n');
     }
     $this->month > 12 and $this->month = 12;
     $this->month < 1 and $this->month = 1;
     $event_dates = \Model_Fleamarket::findByEventDate($this->year, $this->month);
     $this->calendar = $this->buildCalendar($event_dates);
 }