PHP Class Symfony\Component\Security\Http\HttpUtils

Author: Fabien Potencier ([email protected])
Mostrar archivo Open project: pmjones/php-framework-benchmarks Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\Routing\RouterInterface $router = null ) Constructor.
checkRequestPath ( Request $request, string $path ) : boolean Checks that a given path matches the Request.
createRedirectResponse ( Request $request, string $path, integer $status = 302 ) : Response Creates a redirect Response.
createRequest ( Request $request, string $path ) : Request Creates a Request.

Private Methods

Method Description
generateUrl ( $route, $absolute = false )
resetLocale ( Request $request ) hack (don't have a better solution for now)

Method Details

__construct() public method

Constructor.
public __construct ( Symfony\Component\Routing\RouterInterface $router = null )
$router Symfony\Component\Routing\RouterInterface An RouterInterface instance

checkRequestPath() public method

Checks that a given path matches the Request.
public checkRequestPath ( Request $request, string $path ) : boolean
$request Symfony\Component\HttpFoundation\Request A Request instance
$path string A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
return boolean true if the path is the same as the one from the Request, false otherwise

createRedirectResponse() public method

Creates a redirect Response.
public createRedirectResponse ( Request $request, string $path, integer $status = 302 ) : Response
$request Symfony\Component\HttpFoundation\Request A Request instance
$path string A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
$status integer The status code
return Response A RedirectResponse instance

createRequest() public method

Creates a Request.
public createRequest ( Request $request, string $path ) : Request
$request Symfony\Component\HttpFoundation\Request The current Request instance
$path string A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
return Symfony\Component\HttpFoundation\Request A Request instance