Skip to content

Commit

Permalink
Update with a redirect function example
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Luraine committed Jun 3, 2009
1 parent ed3262a commit fbf5ac8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/example02/index.php
Expand Up @@ -49,6 +49,10 @@ function welcome()
halt(HTTP_UNAUTHORIZED, "no, go away!", array(1,2,3));
break;

case "david":
redirect(url_for('/'));
break;

default:
trigger_error("Not sure $name lives in Twin Peaks", E_USER_NOTICE);
# E_USER_NOTICE doesn't stop app execution
Expand Down Expand Up @@ -121,6 +125,7 @@ function html_my_layout($vars){ extract($vars);?>
<a href="<?=url_for('/welcome/bill')?>">Welcome Bill ?</a> |
<a href="<?=url_for('/welcome/leland')?>">Welcome Leland ?</a> |
<a href="<?=url_for('/welcome/bob')?>">Welcome Bob ?</a> |
<a href="<?=url_for('/welcome/david')?>">Welcome David ?</a> |
<a href="<?=url_for('/welcome/audrey')?>">Welcome Audrey ?</a> |
</p>
</body>
Expand Down

0 comments on commit fbf5ac8

Please sign in to comment.