Welcome Guest, Not a member yet? Register   Sign In
TWIG
#1

Hello,
I use twig for one of my app, but still encounter some difficulties,
In the same form, when error on "fichier" field occurs,
this, prints errors :
PHP Code:
{% if validation == false %}
<
div class="notification is-danger">
{{ 
validation_list_errors() }}
</
div>
{% endif %} 

While this does not :
PHP Code:
  {% if validation.hasError("fichier") %}
      <div class="notification is-danger">{{ validation.getError("fichier") }}</div>
  {% endif %} 
can someone see the mistake I make ?
Reply
#2

Use dump() and see what is the variable.
See https://twig.symfony.com/doc/3.x/functions/dump.html
Reply
#3

Shame on me!
there was an ugly $validation = false; in my controller code. i'm tired.
Thanks for reply.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB