Skip to content

Instantly share code, notes, and snippets.

@monsat
Created October 9, 2011 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monsat/1273792 to your computer and use it in GitHub Desktop.
Save monsat/1273792 to your computer and use it in GitHub Desktop.
disable DebugKit if Ajax request by using CakePHP2.0
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