eZPublishCommunityProject  2013.9
eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter Class Reference

Extension of Symfony default router implementing RequestMatcherInterface. More...

+ Inheritance diagram for eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter:
+ Collaboration diagram for eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter:

Public Member Functions

 __construct (ContainerInterface $container, $resource, array $options=array(), RequestContext $context=null)
 
 generate ($name, $parameters=array(), $referenceType=self::ABSOLUTE_PATH)
 
 matchRequest (Request $request)
 
 setLegacyAwareRoutes (array $routes)
 Injectes route names that are allowed to run with legacy_mode: true. More...
 
 setNonSiteAccessAwareRoutes (array $routes)
 Injects route names that are not supposed to be SiteAccess aware. More...
 
 setSiteAccess (SiteAccess $siteAccess=null)
 

Protected Member Functions

 getConfigResolver ()
 
 isLegacyAwareRoute ($routeName)
 Checks if $routeName can be used in legacy mode. More...
 
 isSiteAccessAwareRoute ($routeName)
 Checks if $routeName is a siteAccess aware route, and thus needs to have siteAccess URI prepended. More...
 

Protected Attributes

 $legacyAwareRoutes = array()
 
 $nonSiteAccessAwareRoutes = array()
 
 $serviceContainer
 
 $siteAccess
 

Detailed Description

Extension of Symfony default router implementing RequestMatcherInterface.

Constructor & Destructor Documentation

eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::__construct ( ContainerInterface  $container,
  $resource,
array  $options = array(),
RequestContext  $context = null 
)

Member Function Documentation

eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::generate (   $name,
  $parameters = array(),
  $referenceType = self::ABSOLUTE_PATH 
)
eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::getConfigResolver ( )
protected
Returns
ConfigResolverInterface

Referenced by eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter\matchRequest().

eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::isLegacyAwareRoute (   $routeName)
protected

Checks if $routeName can be used in legacy mode.

Parameters
string$routeName
Returns
bool

Referenced by eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter\matchRequest().

eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::isSiteAccessAwareRoute (   $routeName)
protected

Checks if $routeName is a siteAccess aware route, and thus needs to have siteAccess URI prepended.

Will be used for link generation, only in the case of URI SiteAccess matching.

Parameters
$routeName
Returns
bool

Referenced by eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter\generate().

eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::matchRequest ( Request  $request)
Parameters
\Symfony\Component\HttpFoundation\Request$requestThe request to match
Returns
array An array of parameters
Exceptions
ResourceNotFoundExceptionIf no matching resource could be found
MethodNotAllowedExceptionIf a matching resource was found but the request method is not allowed
eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::setLegacyAwareRoutes ( array  $routes)

Injectes route names that are allowed to run with legacy_mode: true.

Parameters
array$routes
eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::setNonSiteAccessAwareRoutes ( array  $routes)

Injects route names that are not supposed to be SiteAccess aware.

i.e. Routes pointing to asset generation (like assetic).

Parameters
array$routes
eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::setSiteAccess ( SiteAccess  $siteAccess = null)

Member Data Documentation

eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::$legacyAwareRoutes = array()
protected
eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::$nonSiteAccessAwareRoutes = array()
protected
eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::$serviceContainer
protected
eZ\Bundle\EzPublishCoreBundle\Routing\DefaultRouter::$siteAccess
protected

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