<commit_before><?php
// Widget基类，仅限模块的widget调用       
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2018 http://www.eacoo123.com, All rights reserved.         
// +----------------------------------------------------------------------
// | [EacooPHP] 并不是自由软件,可免费使用,未经许可不能去掉EacooPHP相关版权。
// | 禁止在EacooPHP整体或任何部分基础上发展任何派生、修改或第三方版本用于重新分发
// +----------------------------------------------------------------------
// | Author:  心云间、凝听 <<EMAIL>>
// +----------------------------------------------------------------------
namespace app\common\controller;

class Widget extends Base {

	public function _initialize() {
        parent::_initialize();
    }

    /**
     * widget模版输出
     * @param  string $templateFile 模板文件名
     * @param  array  $vars         模板输出变量
     * @param  array  $replace      模板替换
     * @param  array  $config       模板参数
     * @param  array  $render       是否渲染内容
     * @return [type]               [description]
     */
    public function fetch($template='', $vars = [], $replace = [], $config = [] ,$render=false) {
		$class      = get_class($this);
		$names      = explode('\\', $class);
		$module     = $names[1];
		$controller = strtolower($names[3]);

		$widget_view_path = APP_PATH.$module.'/view/';
        $template_path = '';
        if (MODULE_MARK === 'admin') {
            $template_path = 'admin/';
        }
        $template_path .= 'widget/';
        if ($template != '') {
        	$template_path .= $controller.'/'.$template;
        	$template = $widget_view_path.$template_path. '.' .config('template.view_suffix');
            if (!is_file($template)) {
                throw new \Exception('模板不存在：'.$template, 5001);
            }
            
           echo $this->view->fetch($template, $vars, $replace, $config, $render);
        }
    }
}<commit_msg>修正模块钩子，前端显示错误；<commit_after><?php
// Widget基类，仅限模块的widget调用       
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2018 http://www.eacoo123.com, All rights reserved.         
// +----------------------------------------------------------------------
// | [EacooPHP] 并不是自由软件,可免费使用,未经许可不能去掉EacooPHP相关版权。
// | 禁止在EacooPHP整体或任何部分基础上发展任何派生、修改或第三方版本用于重新分发
// +----------------------------------------------------------------------
// | Author:  心云间、凝听 <<EMAIL>>
// +----------------------------------------------------------------------
namespace app\common\controller;
use think\Db;

class Widget extends Base {

	public function _initialize() {
        parent::_initialize();
    }

    /**
     * widget模版输出
     * @param  string $templateFile 模板文件名
     * @param  array  $vars         模板输出变量
     * @param  array  $replace      模板替换
     * @param  array  $config       模板参数
     * @param  array  $render       是否渲染内容
     * @return [type]               [description]
     */
    public function fetch($template='', $vars = [], $replace = [], $config = [] ,$render=false) {
		$class      = get_class($this);
		$names      = explode('\\', $class);
		$module     = $names[1];
		$controller = strtolower($names[3]);

		$widget_view_path = APP_PATH.$module.'/view/';
        $template_path = '';
        if (MODULE_MARK === 'admin') {
            $template_path = 'admin/';
        }elseif (MODULE_MARK=='front' && is_file(APP_PATH . 'install.lock')) {
            //主题区分pc和移动端
            $pc_theme = Db::name('themes')->where('current', 1)->cache('pc_theme', 3600)->value('name');
            $mobile_theme = Db::name('themes')->where('current', 2)->cache('mobile_theme', 3600)->value('name');
            if (IS_MOBILE == true) {
                $current_theme = !empty($mobile_theme) ? $mobile_theme : ($pc_theme ? $pc_theme : '');
            } else {
                $current_theme = !empty($pc_theme) ? $pc_theme : ($mobile_theme ? $mobile_theme : '');
            }
            //定义当前主题
            defined('CURRENT_THEME') or define('CURRENT_THEME', $current_theme);
            $current_theme_path = THEME_PATH . $current_theme . '/'; //默认主题设为当前主题
        }
        $template_path .= 'widget/';
        if ($template != '') {
        	$template_path .= $controller.'/'.$template;
            if (MODULE_MARK === 'admin') {
                $template = $widget_view_path.$template_path. '.' .config('template.view_suffix');
            }elseif (MODULE_MARK=='front' && is_file(APP_PATH . 'install.lock')) {
                $template = $current_theme_path.$module.'/'.$template_path. '.' .config('template.view_suffix');
            }
            if (!is_file($template)) {
                throw new \Exception('模板不存在：'.$template, 5001);
            }
            
           echo $this->view->fetch($template, $vars, $replace, $config, $render);
        }
    }
}
{'fraction_non_alphanumeric': 0.2672395724166841, 'fraction_numerical': 0.009222385244183609, 'mean_word_length': 1.5356004250797024, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4917479', 'n_tokens_mistral': 1536, 'n_tokens_neox': 1563, 'n_words': 236}