model = new ConfigModel(); parent::__construct($app); } public function index() { $config = $this->model->findById(1); if ($this->request->isAjax()) { $this->model->where('id', 1)->update($this->request->param()); return $this->ok(true); } View::assign('config', $config); return view(); } }