public function add() { if (IS_POST) { $entity = array('title' => I('post.title', '', 'trim'), 'notes' => I('post.notes', '', 'trim')); parent::add($entity); } else { $this->display(); } }
/** * 添加 */ public function add() { if (IS_GET) { $this->configVars(); $this->display(); } else { $menu = I('post.'); parent::add($menu, U('Ucenter/Config/index')); } }