Created
October 9, 2011 15:15
-
-
Save monsat/1273792 to your computer and use it in GitHub Desktop.
disable DebugKit if Ajax request by using CakePHP2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function beforeFilter() { | |
$this->disableDebugKitIfisAjax(); | |
} | |
protected function disableDebugKitIfisAjax() { | |
if ($this->request->isAjax()) { | |
Configure::write('debug', 0); | |
$this->Components->disable('Toolbar'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment