AnonymousGE
AnonymousGE

Reputation: 51

Render form in eZ Publish 5

I have a small issue with rendering a form. Specifically I am rendering a form but I can't get its description value. I am rendering my form this way:

    {{ form_start( form ) }}    
    {{ form_errors( form ) }}
     {% for form_child_key, form_child in form.children %}
         This is label;         {{ form_child.vars.label }}
         and here i whant to render description like this:
         {{ form_child.vars.description }} but this is not working
     {% endfor %}
{{ form_end(form) }}

Upvotes: 0

Views: 47

Answers (1)

harmstyler
harmstyler

Reputation: 1401

This is a Symfony question, not necessarily an eZ Publish one. eZ uses Symfony to power its kernel. In instances like this, you should be looking at the Symfony form docs.

It looks like you are using your form start/end tags correctly, you are just missing the form children calls. Try this:

{{ form_start( form ) }}    
    {{ form_errors( form ) }}
    {% for form_child in form.children %}
        {{ form_row(form_child) }}

        {* you can also call parts directly: *}

        {{ form_label(form_child) }}
        {{ form_widget(form_child) }}
        {{ form_errors(form_child) }}
    {% endfor %}
{{ form_end(form) }}

Upvotes: 0

Related Questions