/** Add a new vacancy * @access public */ public function addAction() { $form = new VacancyForm(); $form->submit->setLabel('Add a new vacancy'); $this->view->form = $form; if ($this->getRequest()->isPost()) { if ($form->isValid($this->_request->getPost())) { $this->_vacancies->add($form->getValues()); $this->getFlash()->addMessage('Vacancy details created: ' . $form->getValue('title')); $this->redirect(self::REDIRECT); } else { $form->populate($form->getValues()); } } }