We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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!