跳转到内容

\$debugging_ctrl {#variable.debugging.ctrl}

这允许通过其他方式启用调试。NONE 意味着不允许使用其他方法。URL 意味着当在 QUERY_STRING 中找到关键字 SMARTY_DEBUG 时,将为此脚本调用启用调试。如果 $debugging 为 TRUE,则忽略此值。

<?php
// shows debug console only on localhost ie
// https:///script.php?foo=bar&SMARTY_DEBUG
$smarty->debugging = false; // the default
$smarty->debugging_ctrl = ($_SERVER['SERVER_NAME'] == 'localhost') ? 'URL' : 'NONE';
?>

另请参见 调试控制台 部分、$debugging$smarty_debug_id