Extend Action.redirect() (add new param "permanently" for set header 301 Moved permanently).
This commit is contained in:
@ -39,9 +39,13 @@ abstract class Action
|
||||
* Redirect
|
||||
*
|
||||
* @param mixed $url
|
||||
* @param bool $permanently
|
||||
*/
|
||||
protected function redirect($url = null)
|
||||
protected function redirect($url = null, $permanently = false)
|
||||
{
|
||||
if ($permanently) {
|
||||
header('HTTP/1.1 301 Moved Permanently');
|
||||
}
|
||||
header('Location: ' . (($url) ? $url : Env::getRequestUri()));
|
||||
exit();
|
||||
}
|
||||
|
Reference in New Issue
Block a user