Skip to content

Instantly share code, notes, and snippets.

@vindia
Created May 19, 2011 20:30
Show Gist options
  • Save vindia/981663 to your computer and use it in GitHub Desktop.
Save vindia/981663 to your computer and use it in GitHub Desktop.
Override CakePHP redirect
<?php
# in app_controller.php
function redirect($url, $status = null, $exit = true) {
if(Configure::read('debug') > 0 && !is_array($url)) {
$this->layout = false;
echo sprintf('%1$s redirect to <a href="%2$s">%2$s</a>', $status, $url);
exit;
} else {
return parent::redirect($url, $status, $exit);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment