1

私はたくさんの議論を必要とする道を持っています:

{{ path('work_path', {'username': work.user.username, 'work_id': work.id, 'work_slug': work.slug}) }}

どこでもこの長い線を使用する代わりに、このパス専用の特定の機能が必要です。

Is there a way to call the path() function from my custom function (besides passing the Router service to the extension class)?

4

1 に答える 1

0

考えられる解決策の 1 つとして、独自のtwig マクロを作成することに興味があるかもしれません。

于 2013-01-27T19:37:09.573 に答える