Reputation: 383
IN the every template i need to use this ststement
{{ form_stylesheet(form) }}
{{ form_javascript(form) }}
The the template gives error if the page is not haviing any form variable i.e its normal page.
Is there any way that i can check if form
is present then load those otherwise not
if (form.present) then
{{ form_stylesheet(form) }}
{{ form_javascript(form) }}
Upvotes: 0
Views: 650
Reputation: 48893
{% if form is defined %}
{{ form_stylesheet(form) }}
{{ form_javascript(form) }}
{% endif %}
http://twig.sensiolabs.org/doc/tags/if.html
Upvotes: 2