public function index() { $dayofweek = intval(date('N')) - 1; $days = array(); for ($i = $dayofweek; $i >= 0; $i--) { $days[] = Calendar_Controller::day(date('Y-m-d', strtotime("-{$i} days"))); } for ($i = $dayofweek + 1; $i < 7; $i++) { $days[] = Calendar_Controller::day(date('Y-m-d', strtotime('+' . ($i - $dayofweek) . ' days'))); } $this->template->content = new View('homepage'); $this->template->content->week = new View('calendar/week'); $this->template->content->week->days = $days; $this->template->content->week->doNotJumpToCalendar = true; $this->template->title = 'Smart Student - Ce faci azi?'; }