Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Iterating over forms in phalcon

I can't find a category called "forms" so I will post this in "Internals".

Following scenario: I have to build a scaffolding solution for an admin interface. Now I am stuck at the form generation:

{% block content %}
 {{ form('/admin/' ~ controller ~ '/add', 'class': 'ui form') }}
    {% for element in form %}
        <div class="field">
            {{ element }}
        </div>
    {% endfor %}
{% endblock %}

This works quiet well. But I can't find a solution to render the associated field label. So I need a way to iterate over a form and print out the labels, error messages and so on.

Maybe there is already a solution within this forum. I can't find any. Any ideas?

THX

Thank you, that's exactly what I am searching for!