Thanks! My two cents :) :
{% if layout_login is not defined %}
{% if error %}
<div>{{ error|trans({}, 'FOSUserBundle') }}</div>
{% endif %}
<form action="{{ path("fos_user_security_check") }}" method="post">
<input type="hidden" name="_csrf_token" value="{{ csrf_token
}}" />
<label for="username">{{ 'security.login.username'|trans({},
'FOSUserBundle') }}</label>
<input type="text" id="username" name="_username" value="{{
last_username }}" />
<label for="password">{{ 'security.login.password'|trans({},
'FOSUserBundle') }}</label>
<input type="password" id="password" name="_password" />
<input type="checkbox" id="remember_me" name="_remember_me"
value="on" />
<label for="remember_me">{{
'security.login.remember_me'|trans({}, 'FOSUserBundle') }}</label>
<input type="submit" id="_submit" name="_submit" value="{{
'security.login.submit'|trans({}, 'FOSUserBundle') }}" />
</form>
{% endif %}
On Thursday, 12 July 2012 16:43:18 UTC+2, Christophe Coevoet wrote:
> Le 12/07/2012 16:02, tirengarfio a écrit :
> Hi,
> I just don't want to show the login form of the layout in the main login
> page..
> I tried to set a variable in the login child template ({% set
> layout_login = false %}) and checking its value in the layout, but i
> needed to set also the variable in the layout ({% set layout_login = true
> %}), and it always catches the value of the variable set in the layout
> (true)....
> And tried also setting a variable in the controller, but there isn't
> anything like isset() in twig...
> There is:
> - the defined test allows you to check if the variable is defined:
> http://twig.sensiolabs.org/doc/tests/defined.html
> - the default filter allows you to get a default value for undefined or
> empty variables (beware that false is an empty value):
> http://twig.sensiolabs.org/doc/filters/default.html
> --
> Christophe | Stof