在Twig模板中获取 request参数

app.request.server.get('HTTP_X_REQUESTED_WITH') 就是 $_SERVER['HTTP_X_REQUESTED_WITH']php


相关的参数 或者 变量 常量session


Symfony\Component\HttpKernel\Kernel
Symfony\Component\HttpFoundation\Request
Symfony\Component\Security\Core\SecurityContext
Symfony\Component\HttpFoundation\Session
Symfony\Component\Security\Core\Authentication\Token\TokenInterface::getUserapp


能够在twig中获取的url


例如code

{{app.kernel.cachedir}}
{{app.kernel.logdir}}
{{app.kernel.rootdir}}
{{app.request.basepath}}
{{app.request.baseurl}}
{{app.request.uri}}
{{app.security.token.user}}
{{app.session.locale}}
相关文章
相关标签/搜索