$this->redirect('controller/action');
exit();
Thanks to a small enhancement in CakePHP 1.2 in the form of an additional parameter for the redirect() function you can now do:
$this->redirect('controller/action', null, true);
It’s the same functionality as in the previous code snippet, but with the advantage that your code becomes testable (you cannot test a function which contains an exit(), as the exit() also stops the execution of the test).
沒有留言:
張貼留言