diff --git a/library/think/Hook.php b/library/think/Hook.php index 7f5de18c..0ac83e85 100644 --- a/library/think/Hook.php +++ b/library/think/Hook.php @@ -122,9 +122,9 @@ class Hook public static function exec($class, $tag = '', &$params = null) { if ($class instanceof \Closure) { - $result = call_user_func_array($class, [$params]); + $result = call_user_func_array($class, [ & $params]); } elseif (is_object($class)) { - $result = call_user_func_array([$class, $tag], [$params]); + $result = call_user_func_array([$class, $tag], [ & $params]); } else { $obj = new $class(); $result = ($tag && is_callable([$obj, $tag])) ? $obj->$tag($params) : $obj->run($params); diff --git a/library/think/Template.php b/library/think/Template.php index eb721036..844448f4 100644 --- a/library/think/Template.php +++ b/library/think/Template.php @@ -329,6 +329,8 @@ class Template $content = str_replace($this->config['layout_item'], $content, file_get_contents($layoutFile)); } } + } else { + $content = str_replace('{__NOLAYOUT__}', '', $content); } // 模板解析 diff --git a/tpl/dispatch_jump.tpl b/tpl/dispatch_jump.tpl index 9b568fa1..18ee01bd 100644 --- a/tpl/dispatch_jump.tpl +++ b/tpl/dispatch_jump.tpl @@ -1,4 +1,4 @@ - +{__NOLAYOUT__}