PHP Class Autarky\Routing\UrlGenerator

Datei anzeigen Open project: autarky/framework Class Usage Examples

Protected Properties

Property 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

Public Methods

Method 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 method

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 method

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

getRootUrl() public method

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

getRouteUrl() public method

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

setAssetRoot() public method

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

setValidateParams() public method

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
return null | string

$requests protected_oe property

protected RequestStack,Symfony\Component\HttpFoundation $requests
return Symfony\Component\HttpFoundation\RequestStack

$routePathGenerator protected_oe property

protected RoutePathGeneratorInterface,Autarky\Routing $routePathGenerator
return Autarky\Routing\RoutePathGeneratorInterface

$router protected_oe property

protected Router,Autarky\Routing $router
return Router