Gc\Mvc\Controller\Action::getRouteMatch PHP Method

getRouteMatch() public method

Return matched route
public getRouteMatch ( ) : Zend\Mvc\Router\Http\RouteMatch
return Zend\Mvc\Router\Http\RouteMatch
    public function getRouteMatch()
    {
        if (empty($this->routeMatch)) {
            $this->routeMatch = $this->getEvent()->getRouteMatch();
        }
        return $this->routeMatch;
    }

Usage Example

Example #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testGetRouteMatch()
 {
     $this->object->getEvent()->setRouteMatch(new RouteMatch(array('controller' => 'controller')));
     $this->assertInstanceOf('Zend\\Mvc\\Router\\RouteMatch', $this->object->getRouteMatch());
 }