(Yaf >=1.0.0)
Yaf_Response_Abstract::setRedirect — Redirect to another URL
Redirect the client to another URL (sends a Location header).
urlThe URL to redirect to.
Example #1 Yaf_Response_Abstract::setRedirect() example
<?php
class AccountController extends Yaf_Controller_Abstract
{
public function indexAction()
{
if (!Yaf_Session::getInstance()->has("login")) {
/* send a Location header pointing to the login page */
$this->getResponse()->setRedirect("/account/login");
return false; // nothing to render here
}
}
}
?>