PHP Класс Symfony\Component\Routing\Router

Автор: Fabien Potencier ([email protected])
Наследование: implements Symfony\Component\Routing\RouterInterface, implements Symfony\Component\Routing\Matcher\RequestMatcherInterface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$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