修正Hook类 改进Template对于布局的处理

This commit is contained in:
thinkphp
2016-05-20 16:59:26 +08:00
parent d9416c7e2d
commit a24a2155eb
3 changed files with 5 additions and 3 deletions

View File

@@ -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);