public function loginAction() { $form = new AlbumForm(); $form->get('submit')->setAttribute('value', 'login'); $request = $this->getRequest(); if ($request->isPost()) { $album = new Album(); $form->setInputFilter($album->getInputFilter()); $form->setData($request->getPost()); if ($form->isValid()) { $album->exchangeArray($form->getData()); $this->getAlbumTable()->checkLogin($album); // Redirect to list of albums return $this->redirect()->toRoute('album',array('action'=>'index')); } } return array('form' => $form); }