eZPublishCommunityProject  2013.5
eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter Class Reference
+ Inheritance diagram for eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter:
+ Collaboration diagram for eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter:

Public Member Functions

 __construct (ContainerInterface $container, RequestContext $context=null, LoggerInterface $logger=null)
 
 generate ($name, $parameters=array(), $absolute=false)
 Generates a URL for an eZ Publish legacy fallback route, from the given parameters. More...
 
 getContext ()
 Gets the request context. More...
 
 getRouteCollection ()
 Gets the RouteCollection instance associated with this Router. More...
 
 match ($pathinfo)
 Tries to match a URL with a set of routes. More...
 
 setContext (RequestContext $context)
 Sets the request context. More...
 

Public Attributes

const ROUTE_NAME = 'ez_legacy'
 

Private Attributes

 $container
 
 $context
 
 $logger
 

Constructor & Destructor Documentation

eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter::__construct ( ContainerInterface  $container,
RequestContext  $context = null,
LoggerInterface  $logger = null 
)

Member Function Documentation

eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter::generate (   $name,
  $parameters = array(),
  $absolute = false 
)

Generates a URL for an eZ Publish legacy fallback route, from the given parameters.

"module_uri" must be provided as a key in $parameters. The module URI must contain ordered parameters if any (e.g. /content/view/full/2, "full", and "2" being regular ordered parameters. See your module definition for more info.). All additional named parameters will be passed as unordered params in the form "/(<paramName>)/<paramValue"

Example : $params = array( 'module_uri' => '/content/view/full/2', 'offset' => 30, 'limit' => 10 ); $url = $legacyRouter->generate( 'ez_legacy', $params ); // $url will be "/content/view/full/2/(offset)/30/(limit)/10"

Parameters
string$nameThe name of the route
mixed$parametersAn array of parameters
boolean$absoluteWhether to generate an absolute URL
Exceptions
\Symfony\Component\Routing\Exception\RouteNotFoundException
\InvalidArgumentException
Returns
string The generated URL
eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter::getContext ( )

Gets the request context.

Returns
The context
eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter::getRouteCollection ( )

Gets the RouteCollection instance associated with this Router.

Returns
RouteCollection A RouteCollection instance
eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter::match (   $pathinfo)

Tries to match a URL with a set of routes.

If the matcher can not find information, it must throw one of the exceptions documented below.

Parameters
string$pathinfoThe path info to be parsed (raw format, i.e. not urldecoded)
Returns
array An array of parameters
Exceptions
ResourceNotFoundExceptionIf the resource could not be found
MethodNotAllowedExceptionIf the resource was found but the request method is not allowed
eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter::setContext ( RequestContext  $context)

Sets the request context.

Parameters
\Symfony\Component\Routing\RequestContext$contextThe context

Member Data Documentation

eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter::$container
private
eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter::$logger
private
const eZ\Bundle\EzPublishLegacyBundle\Routing\FallbackRouter::ROUTE_NAME = 'ez_legacy'

The documentation for this class was generated from the following file: