PHP Класс Autarky\Routing\UrlGenerator

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$assetRoot null | string The root URL to use for assets, if any.
$requests Symfony\Component\HttpFoundation\RequestStack
$routePathGenerator Autarky\Routing\RoutePathGeneratorInterface
$router Router

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный метод

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() публичный метод

Get the URL to an asset.
public getAssetUrl ( string $path, boolean $relative = false ) : string
$path string
$relative boolean
Результат string

getRootUrl() публичный метод

Get the root URL. Used to generate URLs to assets.
public getRootUrl ( ) : string
Результат string

getRouteUrl() публичный метод

Get the URL to a named route.
public getRouteUrl ( string $name, array $params = [], boolean $relative = false ) : string
$name string
$params array
$relative boolean
Результат string

setAssetRoot() публичный метод

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

setValidateParams() публичный метод

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

Описание свойств

$assetRoot защищенное свойство

The root URL to use for assets, if any.
protected null|string $assetRoot
Результат null | string

$requests защищенное свойство

protected RequestStack,Symfony\Component\HttpFoundation $requests
Результат Symfony\Component\HttpFoundation\RequestStack

$routePathGenerator защищенное свойство

protected RoutePathGeneratorInterface,Autarky\Routing $routePathGenerator
Результат Autarky\Routing\RoutePathGeneratorInterface

$router защищенное свойство

protected Router,Autarky\Routing $router
Результат Router