Overview

Namespaces

  • PHP
  • Thelia
    • Action
    • Controller
    • Core
      • Bundle
      • Event
      • EventListener
      • Template
    • Exception
    • Log
      • Destination
    • Model
      • map
      • om
    • Routing
      • Matcher
    • Tools

Classes

  • TheliaMatcherCollection
  • Overview
  • Namespace
  • Class
  • Tree

Class TheliaMatcherCollection

Collection of Matcher.

Matcher resolve request into controller::method exemple of Matcher : UrlMatcher of HttpKernel component (but it implements UrlMatcherInterface and not RequestMatcherInterface.

Thelia\Routing\TheliaMatcherCollection implements Symfony\Component\Routing\Matcher\RequestMatcherInterface, Symfony\Component\Routing\RequestContextAwareInterface
Namespace: Thelia\Routing
Author: Manuel Raynaud <mraynaud@openstudio.fr>
Located at core/lib/Thelia/Routing/TheliaMatcherCollection.php
Methods summary
public
# __construct( )

Constructor

Constructor

Check if this constructor is needed (is RequestContext needed ? )

public
# add( Symfony\Component\Routing\Matcher\RequestMatcherInterface $matcher, integer $priority = 0 )

allow to add a matcher routing class to the matchers collection matcher must implement RequestMatcherInterface

allow to add a matcher routing class to the matchers collection matcher must implement RequestMatcherInterface

priority can be fixed with $priority parameter

Parameters

$matcher
Symfony\Component\Routing\Matcher\RequestMatcherInterface
$matcher
$priority
integer
$priority set the priority of the added matcher
public array
# getSortedMatchers( )

Sort Matchers by priority

Returns

array
Array of matchers sorted by priority.
public array
# sortMatchers( )

Sort the matcher by priority

Returns

array
Array of matchers sorted by priority.
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.

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

Parameters

$request
Symfony\Component\HttpFoundation\Request
$request The request to match

Returns

array
An array of parameters

Throws

Symfony\Component\Routing\Exception\ResourceNotFoundException
If no matching resource could be found
Symfony\Component\Routing\Exception\MethodNotAllowedException
If a matching resource was found but the request method is not allowed
public
# setContext( Symfony\Component\Routing\RequestContext $context )

Sets the request context.

Sets the request context.

Parameters

$context
Symfony\Component\Routing\RequestContext
$context The context
public Symfony\Component\Routing\RequestContext
# getContext( )

Gets the request context.

Gets the request context.

Returns

Symfony\Component\Routing\RequestContext
The context
Properties summary
protected mixed $context
#
protected array $matchers array()
#
protected mixed $defaultMatcher
#
protected array $sortedMatchers array()
#
thelia API documentation generated by ApiGen 2.8.0