public function actionEdit($albumId) { if ($this->request->isPost()) { try { $this->albums->set(array('artist' => $this->request->getPost('artist', 'html'), 'title' => $this->request->getPost('title', 'html')))->update()->where($albumId); $this->flashSuccess = 'Album has been updated.'; $this->redirectTo('/albums/'); } catch (TableException $e) { $this->flashFail = $e->getMessage(); } } $this->renderAction('edit', $albumId); }