Created
May 19, 2011 20:30
-
-
Save vindia/981663 to your computer and use it in GitHub Desktop.
Override CakePHP redirect
This file contains hidden or 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
<?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