RouterListener::onKernelRequest()

onKernelRequest(GetResponseEvent $event) Parameters GetResponseEvent $event

RouterListener::onKernelFinishRequest()

onKernelFinishRequest(FinishRequestEvent $event) After a sub-request is done, we need to reset the routing context to the parent request so that the URL generator operates on the correct context again. Parameters FinishRequestEvent $event

RouterListener

class RouterListener implements EventSubscriberInterface Initializes the context from the request and sets request attributes based on a matching route. Methods __construct(UrlMatcherInterface|RequestMatcherInterface $matcher, RequestStack $requestStack, RequestContext $context = null, LoggerInterface $logger = null) Constructor. onKernelFinishRequest(FinishRequestEvent $event) After a sub-request is done, we need to reset the routing context to the parent request so that the URL ge

RouterInterface

interface RouterInterface implements UrlMatcherInterface, UrlGeneratorInterface RouterInterface is the interface that all Router classes must implement. This interface is the concatenation of UrlMatcherInterface and UrlGeneratorInterface. Methods setContext(RequestContext $context) Sets the request context. from RequestContextAwareInterface RequestContext getContext() Gets the request context. from RequestContextAwareInterface array match(string $pathinfo) Tries to match a URL pa

RouterListener::getSubscribedEvents()

static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: The method name to call (priority defaults to 0) An array composed of the method name to call and the priority An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: array('eventName' => 'methodName') array('eventName' => array('methodName', $priority)) a

RouterHelper::url()

string url(string $name, mixed $parameters = array(), bool $schemeRelative = false) Generates a URL reference (as an absolute URL or network path) to the route with the given parameters. Parameters string $name The name of the route mixed $parameters An array of parameters bool $schemeRelative Whether to omit the scheme in the generated URL reference Return Value string The generated URL reference See also UrlGeneratorInterface

RouterHelper::path()

string path(string $name, mixed $parameters = array(), bool $relative = false) Generates a URL reference (as an absolute or relative path) to the route with the given parameters. Parameters string $name The name of the route mixed $parameters An array of parameters bool $relative Whether to generate a relative or absolute path Return Value string The generated URL reference See also UrlGeneratorInterface

RouterHelper::getName()

string getName() Returns the canonical name of this helper. Return Value string The canonical name

RouterHelper

class RouterHelper extends Helper RouterHelper manages links between pages in a template context. Methods setCharset(string $charset) Sets the default charset. from Helper string getCharset() Gets the default charset. from Helper __construct(UrlGeneratorInterface $router) Constructor. string path(string $name, mixed $parameters = array(), bool $relative = false) Generates a URL reference (as an absolute or relative path) to the route with the given parameters. string ur

RouterDebugCommand

class RouterDebugCommand extends ContainerAwareCommand A console command for retrieving information about routes. Methods __construct(string|null $name = null) Constructor. from Command ignoreValidationErrors() Ignores validation errors. from Command setApplication(Application $application = null) Sets the application instance for this command. from Command setHelperSet(HelperSet $helperSet) Sets the helper set. from Command HelperSet getHelperSet() Gets the helper set.