PHP Class Symfony\Bundle\FrameworkBundle\Controller\RedirectController

Author: Fabien Potencier ([email protected])
Inheritance: extends Symfony\Component\DependencyInjection\ContainerAware
Afficher le fichier Open project: pmjones/php-framework-benchmarks Class Usage Examples

Méthodes publiques

Méthode Description
redirectAction ( string $route, boolean $permanent = false ) : Response Redirects to another route.
urlRedirectAction ( string $path, boolean $permanent = false, boolean $scheme = null, integer $httpPort = 80, integer $httpsPort = 443 ) : Response Redirects to a URL.

Method Details

redirectAction() public méthode

It expects a route path parameter. By default, the response status code is 301. If the route empty, the status code will be 410. If the permanent path parameter is set, the status code will be 302.
public redirectAction ( string $route, boolean $permanent = false ) : Response
$route string The route pattern to redirect to
$permanent boolean Whether the redirect is permanent or not
Résultat Symfony\Component\HttpFoundation\Response A Response instance

urlRedirectAction() public méthode

By default, the response status code is 301. If the path is empty, the status code will be 410. If the permanent flag is set, the status code will be 302.
public urlRedirectAction ( string $path, boolean $permanent = false, boolean $scheme = null, integer $httpPort = 80, integer $httpsPort = 443 ) : Response
$path string The path to redirect to
$permanent boolean Whether the redirect is permanent or not
$scheme boolean The URL scheme (null to keep the current one)
$httpPort integer The HTTP port
$httpsPort integer The HTTPS port
Résultat Symfony\Component\HttpFoundation\Response A Response instance