/** * Display welcome information * Might display list of program, cycles in a program, or an application welcome page dependign on the url * Enter description here ... */ public function actionIndex() { if (is_null($this->program)) { $this->setVar('programs', $this->_em->getRepository('Jazzee\\Entity\\Program')->findAllActive()); $this->setLayoutVar('layoutTitle', 'Select a Program'); $this->loadView($this->controllerName . '/programs'); return true; } if (empty($this->application)) { $this->setLayoutVar('layoutTitle', $this->program->getName() . ' Application'); $this->setVar('applications', $this->_em->getRepository('Jazzee\\Entity\\Application')->findByProgram($this->program, false, true)); $this->loadView($this->controllerName . '/cycles'); return true; } if (!$this->application->isPublished() or $this->application->getOpen() > new DateTime('now')) { $this->addMessage('error', $this->application->getCycle()->getName() . ' ' . $this->application->getProgram()->getName() . ' is not open for applicants'); $this->redirectPath('apply/' . $this->application->getProgram()->getShortName()); } $this->setLayoutVar('layoutTitle', $this->cycle->getName() . ' ' . $this->program->getName() . ' Application'); $this->setVar('application', $this->application); }