PHP Class Autarky\Routing\UrlGenerator

Afficher le fichier Open project: autarky/framework Class Usage Examples

Protected Properties

Свойство Type Description
$assetRoot null | string The root URL to use for assets, if any.
$requests Symfony\Component\HttpFoundation\RequestStack
$routePathGenerator Autarky\Routing\RoutePathGeneratorInterface
$router Router

Méthodes publiques

Méthode Description
__construct ( Router $router, Autarky\Routing\RoutePathGeneratorInterface $routePathGenerator, Symfony\Component\HttpFoundation\RequestStack $requests, boolean $validateParams = false )
getAssetUrl ( string $path, boolean $relative = false ) : string Get the URL to an asset.
getRootUrl ( ) : string Get the root URL. Used to generate URLs to assets.
getRouteUrl ( string $name, array $params = [], boolean $relative = false ) : string Get the URL to a named route.
setAssetRoot ( string $assetRoot ) Set the root URL for assets. Useful if you're using CDNs.
setValidateParams ( boolean $validateParams ) Set whether the regex pattern of route parameters should be validated on runtime.

Method Details

__construct() public méthode

public __construct ( Router $router, Autarky\Routing\RoutePathGeneratorInterface $routePathGenerator, Symfony\Component\HttpFoundation\RequestStack $requests, boolean $validateParams = false )
$router Router
$routePathGenerator Autarky\Routing\RoutePathGeneratorInterface
$requests Symfony\Component\HttpFoundation\RequestStack
$validateParams boolean

getAssetUrl() public méthode

Get the URL to an asset.
public getAssetUrl ( string $path, boolean $relative = false ) : string
$path string
$relative boolean
Résultat string

getRootUrl() public méthode

Get the root URL. Used to generate URLs to assets.
public getRootUrl ( ) : string
Résultat string

getRouteUrl() public méthode

Get the URL to a named route.
public getRouteUrl ( string $name, array $params = [], boolean $relative = false ) : string
$name string
$params array
$relative boolean
Résultat string

setAssetRoot() public méthode

Set the root URL for assets. Useful if you're using CDNs.
public setAssetRoot ( string $assetRoot )
$assetRoot string

setValidateParams() public méthode

Set whether the regex pattern of route parameters should be validated on runtime.
public setValidateParams ( boolean $validateParams )
$validateParams boolean

Property Details

$assetRoot protected_oe property

The root URL to use for assets, if any.
protected null|string $assetRoot
Résultat null | string

$requests protected_oe property

protected RequestStack,Symfony\Component\HttpFoundation $requests
Résultat Symfony\Component\HttpFoundation\RequestStack

$routePathGenerator protected_oe property

protected RoutePathGeneratorInterface,Autarky\Routing $routePathGenerator
Résultat Autarky\Routing\RoutePathGeneratorInterface

$router protected_oe property

protected Router,Autarky\Routing $router
Résultat Router