增加V助手函数 用于渲染模板和变量赋值

This commit is contained in:
thinkphp
2016-01-27 11:05:27 +08:00
parent 1726a68833
commit 785172460d

View File

@@ -281,3 +281,14 @@ function trace($log = '[think]', $level = 'log')
\think\Log::record($log, $level);
}
}
/**
* 渲染模板输出
* @param string $template 模板文件
* @param array $vars 模板变量
* @return string
*/
function V($template, $vars)
{
return \think\View::instance(Config::get())->fetch($template, $vars);
}