PHP 클래스 Symfony\Component\Routing\Router

저자: Fabien Potencier ([email protected])
상속: implements Symfony\Component\Routing\RouterInterface, implements Symfony\Component\Routing\Matcher\RequestMatcherInterface
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$collection
$context
$defaults
$generator
$loader
$matcher
$options
$resource

공개 메소드들

메소드 설명
__construct ( Symfony\Component\Config\Loader\LoaderInterface $loader, mixed $resource, array $options = [], Symfony\Component\Routing\RequestContext $context = null, array $defaults = [] ) Constructor.
generate ( string $name, array $parameters = [], boolean $absolute = false ) : string Generates a URL from the given parameters.
getContext ( ) : Symfony\Component\Routing\RequestContext Gets the request context.
getGenerator ( ) : UrlGeneratorInterface Gets the UrlGenerator instance associated with this Router.
getMatcher ( ) : UrlMatcherInterface Gets the UrlMatcher instance associated with this Router.
getOption ( string $key ) : mixed Gets an option value.
getRouteCollection ( ) : RouteCollection Gets the RouteCollection instance associated with this Router.
match ( string $url ) : array | false Tries to match a URL with a set of routes.
setContext ( Symfony\Component\Routing\RequestContext $context ) Sets the request context.
setOption ( string $key, mixed $value ) Sets an option.
setOptions ( array $options ) Sets options.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Symfony\Component\Config\Loader\LoaderInterface $loader, mixed $resource, array $options = [], Symfony\Component\Routing\RequestContext $context = null, array $defaults = [] )
$loader Symfony\Component\Config\Loader\LoaderInterface A LoaderInterface instance
$resource mixed The main resource to load
$options array An array of options
$context Symfony\Component\Routing\RequestContext The context
$defaults array The default values

generate() 공개 메소드

Generates a URL from the given parameters.
public generate ( string $name, array $parameters = [], boolean $absolute = false ) : string
$name string The name of the route
$parameters array An array of parameters
$absolute boolean Whether to generate an absolute URL
리턴 string The generated URL

getContext() 공개 메소드

Gets the request context.
public getContext ( ) : Symfony\Component\Routing\RequestContext
리턴 Symfony\Component\Routing\RequestContext The context

getGenerator() 공개 메소드

Gets the UrlGenerator instance associated with this Router.
public getGenerator ( ) : UrlGeneratorInterface
리턴 UrlGeneratorInterface A UrlGeneratorInterface instance

getMatcher() 공개 메소드

Gets the UrlMatcher instance associated with this Router.
public getMatcher ( ) : UrlMatcherInterface
리턴 UrlMatcherInterface A UrlMatcherInterface instance

getOption() 공개 메소드

Gets an option value.
public getOption ( string $key ) : mixed
$key string The key
리턴 mixed The value

getRouteCollection() 공개 메소드

Gets the RouteCollection instance associated with this Router.
public getRouteCollection ( ) : RouteCollection
리턴 RouteCollection A RouteCollection instance

match() 공개 메소드

Returns false if no route matches the URL.
public match ( string $url ) : array | false
$url string URL to be parsed
리턴 array | false An array of parameters or false if no route matches

setContext() 공개 메소드

Sets the request context.
public setContext ( Symfony\Component\Routing\RequestContext $context )
$context Symfony\Component\Routing\RequestContext The context

setOption() 공개 메소드

Sets an option.
public setOption ( string $key, mixed $value )
$key string The key
$value mixed The value

setOptions() 공개 메소드

Available options: * cache_dir: The cache directory (or null to disable caching) * debug: Whether to enable debugging or not (false by default) * resource_type: Type hint for the main resource (optional)
public setOptions ( array $options )
$options array An array of options

프로퍼티 상세

$collection 보호되어 있는 프로퍼티

protected $collection

$context 보호되어 있는 프로퍼티

protected $context

$defaults 보호되어 있는 프로퍼티

protected $defaults

$generator 보호되어 있는 프로퍼티

protected $generator

$loader 보호되어 있는 프로퍼티

protected $loader

$matcher 보호되어 있는 프로퍼티

protected $matcher

$options 보호되어 있는 프로퍼티

protected $options

$resource 보호되어 있는 프로퍼티

protected $resource