Methods summary
public
|
#
__construct( Symfony\Component\Config\Loader\LoaderInterface $loader, mixed $resource, array $options = array(), Symfony\Component\Routing\RequestContext $context = null, Psr\Log\LoggerInterface $logger = null )
Constructor.
Parameters
- $loader
Symfony\Component\Config\Loader\LoaderInterface $loader A LoaderInterface instance
- $resource
mixed $resource The main resource to load
- $options
array $options An array of options
- $context
Symfony\Component\Routing\RequestContext $context The context
- $logger
Psr\Log\LoggerInterface $logger A logger instance
|
public
|
#
setOptions( array $options )
Sets options.
Available options:
* cache_dir: The cache directory (or null to disable caching) * debug: Whether
to enable debugging or not (false by default) * generator_class: The name of a
UrlGeneratorInterface implementation * generator_base_class: The base class for
the dumped generator class * generator_cache_class: The class name for the
dumped generator class * generator_dumper_class: The name of a
GeneratorDumperInterface implementation * matcher_class: The name of a
UrlMatcherInterface implementation * matcher_base_class: The base class for the
dumped matcher class * matcher_dumper_class: The class name for the dumped
matcher class * matcher_cache_class: The name of a MatcherDumperInterface
implementation * resource_type: Type hint for the main resource (optional) *
strict_requirements: Configure strict requirement checking for generators
implementing ConfigurableRequirementsInterface (default is true)
Parameters
- $options
array $options An array of options
Throws
|
public
|
#
setOption( string $key, mixed $value )
Sets an option.
Parameters
- $key
string $key The key
- $value
mixed $value The value
Throws
|
public
mixed
|
#
getOption( string $key )
Gets an option value.
Parameters
Returns
mixed The value
Throws
|
public
Symfony\Component\Routing\RouteCollection
|
#
getRouteCollection( )
Gets the RouteCollection instance associated with this Router.
Gets the RouteCollection instance associated with this Router.
Returns
Implementation of
|
public
|
|
public
Symfony\Component\Routing\RequestContext
|
#
getContext( )
Gets the request context.
Gets the request context.
Returns
Implementation of
|
public
|
#
setConfigCacheFactory( Symfony\Component\Config\ConfigCacheFactoryInterface $configCacheFactory )
Sets the ConfigCache factory to use.
Sets the ConfigCache factory to use.
Parameters
- $configCacheFactory
Symfony\Component\Config\ConfigCacheFactoryInterface $configCacheFactory The factory to use
|
public
string
|
#
generate( string $name, mixed $parameters = array(), integer $referenceType = Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_PATH )
Generates a URL or path for a specific route based on the given
parameters.
Generates a URL or path for a specific route based on the given
parameters.
Parameters
- $name
string $name The name of the route
- $parameters
mixed $parameters An array of parameters
- $referenceType
integer $referenceType The type of reference to be generated (one of the constants)
Returns
string The generated URL
Throws
RouteNotFoundException If the named route doesn't exist
MissingMandatoryParametersException When some parameters are missing that are mandatory for the route
InvalidParameterException When a parameter value for a placeholder is not correct because it does not
match the requirement
Implementation of
|
public
array
|
#
match( string $pathinfo )
Tries to match a URL path with a set of routes.
Tries to match a URL path with a set of routes.
Parameters
- $pathinfo
string $pathinfo The path info to be parsed (raw format, i.e. not urldecoded)
Returns
array An array of parameters
Throws
ResourceNotFoundException If the resource could not be found
MethodNotAllowedException If the resource was found but the request method is not allowed
Implementation of
|
public
array
|
#
matchRequest( Symfony\Component\HttpFoundation\Request $request )
Tries to match a request with a set of routes.
Tries to match a request with a set of routes.
Parameters
- $request
Symfony\Component\HttpFoundation\Request $request The request to match
Returns
array An array of parameters
Throws
ResourceNotFoundException If no matching resource could be found
MethodNotAllowedException If a matching resource was found but the request method is not allowed
Implementation of
|
public
Symfony\Component\Routing\Matcher\UrlMatcherInterface
|
#
getMatcher( )
Gets the UrlMatcher instance associated with this Router.
Gets the UrlMatcher instance associated with this Router.
Returns
|
public
Symfony\Component\Routing\Generator\UrlGeneratorInterface
|
#
getGenerator( )
Gets the UrlGenerator instance associated with this Router.
Gets the UrlGenerator instance associated with this Router.
Returns
|
public
|
|