Hooks::fetch PHP Method

fetch() public method

渲染HTML页面
public fetch ( string $templateFile = '', string $charset = 'utf-8', string $contentType = 'text/html' ) : string
$templateFile string 模板文件路径
$charset string 字符集,默认为UTF8
$contentType string 内容类型,默认为text/html
return string HTML页面数据
    public function fetch($templateFile = '', $charset = 'utf-8', $contentType = 'text/html')
    {
        if (!is_file($templateFile)) {
            $templateFile = realpath($this->path . DIRECTORY_SEPARATOR . 'html' . DIRECTORY_SEPARATOR . $templateFile . '.html');
        }
        // 获取当前Js语言包
        $this->langJsList = setLangJavsScript();
        $this->assign('langJsList', $this->langJsList);
        return fetch($templateFile, $this->tVar, $charset, $contentType, false);
    }