eZ\Publish\Core\MVC\Symfony\Routing\RouteReference::get PHP Méthode

get() public méthode

Returns a route parameter.
public get ( string $parameterName, mixed $defaultValue = null, boolean $deep = false ) : mixed
$parameterName string
$defaultValue mixed
$deep boolean
Résultat mixed
    public function get($parameterName, $defaultValue = null, $deep = false)
    {
        return $this->params->get($parameterName, $defaultValue, $deep);
    }

Usage Example

 public function testDownloadNameOverrideWorks()
 {
     $content = $this->getCompleteContent();
     $routeReference = new RouteReference(ContentDownloadRouteReferenceListener::ROUTE_NAME, [ContentDownloadRouteReferenceListener::OPT_CONTENT => $content, ContentDownloadRouteReferenceListener::OPT_FIELD_IDENTIFIER => 'file', ContentDownloadRouteReferenceListener::OPT_DOWNLOAD_NAME => 'My-custom-filename.pdf']);
     $event = new RouteReferenceGenerationEvent($routeReference, new Request());
     $eventListener = $this->getListener();
     $eventListener->onRouteReferenceGeneration($event);
     self::assertEquals('My-custom-filename.pdf', $routeReference->get(ContentDownloadRouteReferenceListener::OPT_DOWNLOAD_NAME));
 }
All Usage Examples Of eZ\Publish\Core\MVC\Symfony\Routing\RouteReference::get