public function createAction() { $this->useJsonResponse(); if ($this->request->isPost()) { $profile = new Profiles(); $profile->assign(array('name' => $this->request->getPost('name', 'striptags'), 'active' => $this->request->getPost('active'))); if (!$profile->save()) { return array('isError' => true, 'msg' => '添加用户时发生错误'); } else { return array('isError' => false, 'msg' => '添加完成'); } } }