public function edittypesAction($id) { $request = $this->request; if (!$request->isPost()) { $types = Types::findFirstById($id); if (!$types) { $this->flash->error("没有找到对应类型"); return $this->forward("producttypes/index"); } $this->view->form = $this->getForm($types, true); } }