Cleaned up several places regarding redirect and rendering during development for debug purposes. Also, added a link to the intended redirect target when we've rendered instead. These changes haven't been tested, hopefully they are benign.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@563 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -99,6 +99,12 @@ class AppController extends Controller {
|
||||
}
|
||||
|
||||
function redirect($url, $status = null, $exit = true) {
|
||||
// OK, since the controller will not be able to
|
||||
// utilize our overriden url function in AppHelper,
|
||||
// we'll have to do it manually here.
|
||||
App::import('Helper', 'Html');
|
||||
$url = HtmlHelper::url($url, true);
|
||||
|
||||
if (headers_sent()) {
|
||||
// If we've already sent the headers, it's because
|
||||
// we're debugging, and our debug output has gotten
|
||||
@@ -108,17 +114,15 @@ class AppController extends Controller {
|
||||
// the debug output. So, since we can't redirect
|
||||
// anyway, we may as well go with the flow and just
|
||||
// render this page instead, using an empty template
|
||||
$this->set('message',
|
||||
("Intended redirect:<P><BR>" .
|
||||
'<A HREF="'.$url.'">'.$url.'</A>'));
|
||||
|
||||
echo $this->render('/empty');
|
||||
if ($exit)
|
||||
$this->_stop();
|
||||
}
|
||||
|
||||
// OK, since the controller will not be able to
|
||||
// utilize our overriden url function in AppHelper,
|
||||
// we'll have to do it manually here.
|
||||
App::import('Helper', 'Html');
|
||||
$url = HtmlHelper::url($url, true);
|
||||
|
||||
return parent::redirect($url, $status, $exit);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user