• Please allow 5 mins between posts.
  • Although email's are required they are hidden.
  • You can create an avatar that will appear everytime you post on a Gravatar enabled blog.
  • You can use the following tags in your post.
    [code][/code] [url][/url] [img][/img] [quote][/quote] [b][/b] [i][/i] [u][/u]

Redirect with exit()

While creating the admin section for this blog, I needed the script to redirect if the user was not logged in, however I did not realise that by default $this->redirect(); does not include an exit(); I came across an addition to the redirect function to call an exit() with it. Rather than using
<?php
$this->redirect('controller/action');
exit();
?>
You can simply use:
<?php
$this->redirect('controller/action', null, true);
?>

No Comments