File: //www/wwwroot/crm.jmfdbn.com/application/common/controller/Homebase.php
<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 御宅男 <530765310@qq.com>
// +----------------------------------------------------------------------
// +----------------------------------------------------------------------
// | 前台控制模块
// +----------------------------------------------------------------------
namespace app\common\controller;
use app\common\controller\Base;
use think\facade\Config;
class Homebase extends Base
{
//初始化
protected function initialize()
{
//移除HTML标签
$this->request->filter('trim,strip_tags,htmlspecialchars');
parent::initialize();
$config = \think\facade\config::get('app.');
$site = [
'upload_thumb_water' => $config['upload_thumb_water'],
'upload_thumb_water_pic' => $config['upload_thumb_water_pic'],
'upload_image_size' => $config['upload_image_size'],
'upload_file_size' => $config['upload_file_size'],
'upload_image_ext' => $config['upload_image_ext'],
'upload_file_ext' => $config['upload_file_ext'],
];
$this->assign('site', $site);
}
protected function fetch($template = '', $vars = [], $config = [], $renderContent = false)
{
$Theme = empty(Config::get('theme')) ? 'default' : Config::get('theme');
$this->view->config('view_path', TEMPLATE_PATH . $Theme . DIRECTORY_SEPARATOR . $this->request->module() . DIRECTORY_SEPARATOR);
return $this->view->fetch($template, $vars, $config, $renderContent);
}
}