// +---------------------------------------------------------------------- namespace app\teahouse\controller; use cmf\controller\AdminBaseController; use think\Validate; class AdminSettingController extends AdminBaseController { public function index() { $setting = cmf_get_option('teahouse_setting'); $this->assign($setting); return $this->fetch(); } public function indexPost() { $post = array_map('trim', $this->request->param()); if (in_array('', $post) && !empty($post['teahouse_setting'])) { $this->error("不能留空!"); } cmf_set_option('teahouse_setting', $post); $this->success("保存成功!"); } }