打开/关闭cakephp中特定控制器的调试模式 [英] Turn on /off the debug mode for particular controller in cakephp
问题描述
我想在cakephp中打开particualr控制器的调试模式。现在我做这个在config / core.php,它工作正常。但是很容易在控制器中启用/禁用,我们可以避免在活动网站中工作的问题,否则日志会乱掉用户。
I want to turn on the debug mode for particualr controller in cakephp . Now I am doing this in config/core.php ,it working fine . But it is easy to enable /disable in controller ,we can avoid probelms with working in live sites ,otherwise the log will messed up users
推荐答案
它实际上是安全的关键做任何野生像在core.php,它必须和所有用户前端网站始终为0。
its actually security critical to do anything wild like that in the core.php, it has to be and stay always 0 for ALL user frontend sites.
如果你想要为某些管理后台操作启用它,可以在最初的
If you want to enable it for some admin backend action, you can do that inside the action at the very beginning with
Configure::write('debug', 2);
这篇关于打开/关闭cakephp中特定控制器的调试模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!