It is possible to directly pass a Location object as the route name, as the ChainRouter allows it through ChainedRouterInterface.
If $name is a route name, the "location" key in $parameters must be set to a valid eZ\Publish\API\Repository\Values\Content\Location object.
"locationId" can also be provided.
If the generator is not able to generate the url, it must throw the RouteNotFoundException
as documented below.
public generate ( string | eZ\Publish\API\Repository\Values\Content\Location $name, mixed $parameters = [], integer $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH ) : string | ||
$name | string | eZ\Publish\API\Repository\Values\Content\Location | The name of the route or a Location instance |
$parameters | mixed | An array of parameters |
$referenceType | integer | The type of reference to be generated (one of the constants) |
리턴 | string | The generated URL |