SilexとTwigのパス関連をメモしています。
Silexのサービスで呼び出しもとアドレス取得
$app['url_generator']->getContext()->getPathInfo()
Twigで現在のパスを取得
{{ path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}
symfony2 – get current url in twig template? – Stack Overflow
No comments yet.
改行と段落タグは自動で挿入されます。
メールアドレスは表示されません。