我想在我的模板中插入FOSUserBundle的登录表单,如下所示:
<div id="sidebar">
{% render "FOSUserBundle::Security::login" %}
</div>
Run Code Online (Sandbox Code Playgroud)
但最初不要渲染在loginAction()代码中调用的模板.
我以为我觉得在这个例子中传递我想要渲染的模板作为'max'的参数是有用的:
<div id="sidebar">
{% render "AcmeArticleBundle:Article:recentArticles" with {'max':
3} %}
</div>
Run Code Online (Sandbox Code Playgroud)
这在symfony2中可能吗?如果不..
我应该使用loginAction中的相同代码为我的包创建另一个操作吗?或者我应该修改原始的loginAction代码并编写控制结构?
if(currentPage == 'home')
renderResponse('template1')
else
renderResponse('template2')
Run Code Online (Sandbox Code Playgroud) symfony ×1