/** * Allows the users to update their profiles * * @access public * @return void */ public function editAction() { $this->title = 'Edit your profile'; $form = new ProfileForm(); $userModel = new BackofficeUser(); if ($this->getRequest()->isPost()) { if ($form->isValid($this->getRequest()->getPost())) { $userModel->updateProfile($form->getValues()); $this->_helper->FlashMessenger(array('msg-success' => 'Your profile was successfully updated.')); $this->_redirect('/profile/edit/'); } } else { $user = Zend_Auth::getInstance()->getIdentity(); $row = $userModel->findById($user->id); $form->populate($row->toArray()); $this->view->item = $row; } $this->view->form = $form; }