开发者

How can I turn off the CakePHP Profiler for a specific page?

I want to turn off the CakePHP profiler when working locally for a specific page that runs an ajax call. How can I do this?开发者_开发问答


User talelcool's solution is what you need.

However, if you have a lot of actions that deal with AJAX, you could do what I do and put it in the beforeFilter. You'll need the RequestHandler component though.

class AppController extends Controller {

    var $components = array('RequestHandler');

    function beforeFilter() {

      if ($this->RequestHandler->isAjax()) {  
          Configure::write('debug',0);  
      }  

    }
}


simple , in your action put function action() { .... ; Configure::write('debug', '0'); .... ; }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜