2017-11-16 3 views
1

Gemäß der Pimcore 5 Dokumentation:aus dem Inneren eines Controllers mit Pimcore 5.x

URLs are generated using the default URL helper of Symfony $this->path() and $this->url(). Additionally to the standard helpers for generating URLs, Pimcore offers a special templating helper ($this->pimcoreUrl()) to generate URLs like you did with Pimcore 4. You can define a placeholder in the reverse pattern with %NAME and it is also possible to define an optional part, to do so just embrace the part with curly brackets { } (see example below).

https://pimcore.com/docs/5.0.x/Development_Documentation/MVC/Routing_and_URLs/Custom_Routes.html

ich sollte in der Lage sein, umkehren eine Route konstruieren mit dem Pfad-Methode wie so:

$this->path('MyRouteName', [ 
    'route_param_a' => 'A', 
    'route_param_b' => 'B', 
    'route_param_c' => 'C' 
]); 

Leider, wenn ich das nennen aus dem Inneren eines Controllers, erhalte ich folgende Fehlermeldung:

Gibt es im Controller-Bereich eine ähnliche Funktion oder Methode, mit der ich meine Pfade generieren kann, wenn ich mit meinem JSON-Objekt direkt vom Controller aus antworte (ohne eine Sicht zu verwenden)?

Antwort

Verwandte Themen