public function updateAction($id) { $model = Cupons::findFirst('id =' . $id); $this->view->cupom = $model; $this->view->form = new CupomForm($model, array('edit' => true)); if ($this->request->isPost()) { $this->save($model); } }