問題描述
我想在 cakephp 中打開特定控制器的調(diào)試模式.現(xiàn)在我在 config/core.php 中這樣做,它工作正常.但是在控制器中啟用/禁用很容易,我們可以避免在現(xiàn)場工作時(shí)出現(xiàn)問題,否則日志會(huì)弄亂用戶
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 中做任何類似的事情實(shí)際上安全至關(guān)重要,對(duì)于所有用戶前端站點(diǎn),它必須始終為 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.
如果您想為某些后臺(tái)管理操作啟用它,您可以在一開始的操作中使用
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);
這篇關(guān)于在 cakephp 中打開/關(guān)閉特定控制器的調(diào)試模式的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!