Include template avec paramètres variable pas tjs disponible
Bonjour,
Comment include un template twig avec variable si la variable n'existe pas tjs ?
Par exemple
Code:
1 2 3 4 5
|
{% block content %}
<h1>Identifiez vous</h1>
{% include 'MasocietUserBundle:Auth:form_login.html.twig' with {'error': error, 'last_username': last_username} %}
{% endblock %} |
Ici j'inclus mon formulaire de login dans un coin de mon layout, mais j'ai une error car les variables error et last_username n'existe pas
J'ai vu que le problème pourrait être réglé dans twig 1.2 grace à "ignore missing" à mettre juste avant le "with"
Citation:
New in version 1.2: The ignore missing feature has been added in Twig 1.2.
En attendant twig 1.2 comment régler mon problème ?