Symfony URL的绝对路径

Symfony URL的绝对路径,symfony,Symfony,我有URL,例如 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,例如

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的绝对路径

我经常对图像或资产使用绝对路径,例如

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创建绝对路径?

这种URL可以使用
{{path()}
编写

例如:

<a href="{{ path('profile-change-password') }}">
  Change password
</a>
<a href="{{ url('my_home_route') }}">
  Home
</a>


如果需要绝对路径,则

{{ url() }}
例如:

<a href="{{ path('profile-change-password') }}">
  Change password
</a>
<a href="{{ url('my_home_route') }}">
  Home
</a>

谢谢!!这是我应该知道的基本功能。