PHP Class Zend\Mvc\RouteListener

Inheritance: implements Zend\EventManager\ListenerAggregateInterface
Show file Open project: zendframework/zend-mvc

Public Methods

Method Description
attach ( Zend\EventManager\EventManagerInterface $events, integer $priority = 1 ) : void Attach to an event manager
onRoute ( MvcEvent $event ) : null | Zend\Router\RouteMatch Listen to the "route" event and attempt to route the request

Method Details

attach() public method

Attach to an event manager
public attach ( Zend\EventManager\EventManagerInterface $events, integer $priority = 1 ) : void
$events Zend\EventManager\EventManagerInterface
$priority integer
return void

onRoute() public method

If no matches are returned, triggers "dispatch.error" in order to create a 404 response. Seeds the event with the route match on completion.
public onRoute ( MvcEvent $event ) : null | Zend\Router\RouteMatch
$event MvcEvent
return null | Zend\Router\RouteMatch