开发者

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

开发者 https://www.devze.com 2023-03-01 06:43 出处:网络
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.

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

精彩评论

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