mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
小细节优化
This commit is contained in:
@@ -294,7 +294,7 @@ function trace($log = '[think]', $level = 'log')
|
|||||||
* @param array $vars 模板变量
|
* @param array $vars 模板变量
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function V($template, $vars)
|
function V($template = '', $vars = [])
|
||||||
{
|
{
|
||||||
return \think\View::instance(\think\Config::get())->fetch($template, $vars);
|
return \think\View::instance(\think\Config::get())->fetch($template, $vars);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ class Route
|
|||||||
if (false !== $match = self::match($url, $rule, $pattern)) {
|
if (false !== $match = self::match($url, $rule, $pattern)) {
|
||||||
// 匹配到路由规则
|
// 匹配到路由规则
|
||||||
// 检测是否定义路由
|
// 检测是否定义路由
|
||||||
if ($option['after_behavior']) {
|
if (!empty($option['after_behavior'])) {
|
||||||
Hook::exec($option['after_behavior'], $route);
|
Hook::exec($option['after_behavior'], $route);
|
||||||
}
|
}
|
||||||
if ($route instanceof \Closure) {
|
if ($route instanceof \Closure) {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class Template
|
|||||||
*/
|
*/
|
||||||
public function __construct(array $config = [])
|
public function __construct(array $config = [])
|
||||||
{
|
{
|
||||||
$this->config['cache_path'] = RUNTIME_PATH . 'template' . DS;
|
$this->config['cache_path'] = RUNTIME_PATH . 'temp' . DS;
|
||||||
$this->config = array_merge($this->config, empty($config) ? (array) Config::get('template') : $config);
|
$this->config = array_merge($this->config, empty($config) ? (array) Config::get('template') : $config);
|
||||||
$this->config['taglib_begin'] = $this->stripPreg($this->config['taglib_begin']);
|
$this->config['taglib_begin'] = $this->stripPreg($this->config['taglib_begin']);
|
||||||
$this->config['taglib_end'] = $this->stripPreg($this->config['taglib_end']);
|
$this->config['taglib_end'] = $this->stripPreg($this->config['taglib_end']);
|
||||||
|
|||||||
Reference in New Issue
Block a user