123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // +----------------------------------------------------------------------
- // | Author: 小夏 < 449134904@qq.com>
- // +----------------------------------------------------------------------
- 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("保存成功!");
- }
- }
|