增加halt方法用于变量调试并中断输出

This commit is contained in:
thinkphp
2016-08-12 16:11:29 +08:00
parent 53c06a8015
commit 895888bb15

View File

@@ -511,3 +511,15 @@ if (!function_exists('abort')) {
}
}
}
if (!function_exists('halt')) {
/**
* 调试变量并且中断输出
* @param mixed $var 调试变量或者信息
*/
function halt($var)
{
dump($var);
throw new \think\exception\HttpResponseException(new Response);
}
}