In Twig template I check if a field has an error like this:
{% if form.points.get(\'errors\') is not empty %}
Is there any method like:
i have create a twig extension to handle this: my extension
public function hasError($string) { if(strlen($string) > 4) return true; return false; }
i use it like this in twig
{{ has_error(form_errors(form.username)) ? form_errors(form.username) : '' }}