Neos\Flow\Mvc\Routing\Route::getMatchResults PHP Method

getMatchResults() public method

Returns an array with the Route match results.
See also: Neos\Flow\Mvc\Routing\Router
public getMatchResults ( ) : array
return array An array of Route Parts and their values for further handling by the Router
    public function getMatchResults()
    {
        return $this->matchResults;
    }

Usage Example

 /**
  * @test
  */
 public function defaultValuesAreSetForUriPatternSegmentsWithMultipleOptionalRouteParts()
 {
     $this->route->setUriPattern('{key1}-({key2})/({key3}).({key4}.{@format})');
     $defaults = ['key1' => 'defaultValue1', 'key2' => 'defaultValue2', 'key3' => 'defaultValue3', 'key4' => 'defaultValue4', '@format' => 'xml'];
     $this->route->setDefaults($defaults);
     $this->routeMatchesPath('foo-/.bar.xml');
     $this->assertEquals(['key1' => 'foo', 'key2' => 'defaultValue2', 'key3' => 'defaultValue3', 'key4' => 'bar', '@format' => 'xml'], $this->route->getMatchResults(), 'Route match results should be set correctly on successful match');
 }