📜  symfony 获取基本 url - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:35.158000             🧑  作者: Mango

代码示例1
This is now available for free in twig templates (tested on sf2 version 2.0.14)
{{ app.request.getBaseURL() }}


In later Symfony versions (tested on 2.5), try :
{{ app.request.getSchemeAndHttpHost() }}