params; $this->model = new UserModel(); // 根据不同方法处理一些业务 switch ($method) { case 'index': // 请求类型是否为POST if ($this->isPost) { // 条件语句 if (!empty($params['keyword'])) $this->model->where('title', 'like', "%{$params['keyword']}%"); if (!empty($params['status'])) $this->model->where('status', $params['status']); } break; // case 'insert': // break; // case 'update': // break; default: break; } return parent::callAction($method, $parameters); // TODO: Change the autogenerated stub } public function __construct(array $attributes = []) { parent::__construct(); } }