-
Notifications
You must be signed in to change notification settings - Fork 10
Redirect
Stefano Azzolini edited this page Aug 27, 2014
·
3 revisions
The Redirect module handles request agent redirection to other locations.
A simple Location
header redirection can be achieved via the Redirect::to($url)
method.
if ( ! Session::get('loggedUser') ) Redirect::to('/login');
Warning :
The
to
method performs an immediate exit.
The Redirect::viaJavaScript($url)
method send to the browser a script for location
redirection.
Redirect::viaJavaScript('/login');
This outputs :
<script>location.href="/login"</script>
If the optional boolean parameter
$parent
is passed astrue
theparent.location
object is used. This is useful for redirecting inside iframes, like in Facebook Page Tab apps.
Core is maintained by using the Semantic Versioning Specification (SemVer).
Copyright 2014-2016 Caffeina srl under the MIT license.
http://caffeina.com