(Yaf >=1.0.0)
Yaf_Controller_Abstract::redirect — Redirige vers une URL
Redirige le client vers une autre URL en envoyant un en-tête
Location (statut HTTP 302).
urlL'URL vers laquelle rediriger.
Exemple #1 Exemple avec Yaf_Controller_Abstract::redirect()
<?php
class AccountController extends Yaf_Controller_Abstract
{
public function loginAction() {
if (!$this->getRequest()->getParam("user")) {
// envoie un en-tête Location avec le statut HTTP 302
$this->redirect("http://www.example.com/account/login/");
return false; // ignore le rendu automatique
}
}
}
?>