Skip to content

\$debugging_ctrl {/programmers/api-variables/variable-debugging/.ctrl}

这个变量允许使用替代方法来启用调试功能。NONE 表示不允许使用替代方法。URL 表示当 QUERY_STRING 中出现关键字 SMARTY_DEBUG 时,将启用该脚本的调试功能。如果 $debugging 为 TRUE,则忽略此值。

<?php
// 仅在本地主机上显示调试控制台,例如:http://localhost/script.php?foo=bar&SMARTY_DEBUG
$smarty->debugging = false; // 默认值
$smarty->debugging_ctrl = ($_SERVER['SERVER_NAME'] == 'localhost') ? 'URL' : 'NONE';
?>

另请参阅 debugging console 部分,$debugging$smarty_debug_id