PHP 클래스 Autarky\Routing\UrlGenerator

파일 보기 프로젝트 열기: autarky/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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