我有这样的urls
http://localhost/test/web/app_dev.php/
http://localhost/test/web/app_dev.php/profile/change-password
http://localhost/test/web/app_dev.php/member/form/test我想获得这些网址的绝对路径
我经常使用图像或资源的绝对路径,例如
{{ asset('bundles/acmedemo/images/title_contact.gif') }}但是这些URL不在某个捆绑包目录下。我应该使用什么方法来为这些URL创建绝对路径?
发布于 2013-06-11 02:19:41
这种url可以使用{{ path() }}编写。
例如:
<a href="{{ path('profile-change-password') }}">
Change password
</a>http://symfony.com/doc/current/book/routing.html#generating-urls-from-a-template
发布于 2014-03-05 16:48:13
如果你需要绝对路径那么..。
{{ url() }}例如:
<a href="{{ url('my_home_route') }}">
Home
</a>https://stackoverflow.com/questions/17030126
复制相似问题