Friday, October 21, 2022

[FIXED] How to loop through multiple models in Phalcon with.volt files

Issue

I have three models in my project and I need to loop through all these models to display the content of 3 tables. SO wat I wnat to know is how to display a has many to belongs to relation in .volt file(a join in sql)?


Solution

Pass to view variable with your model and then in view:

{% for item in model.alias of related relation %}
do something with item
{% endfor %}


Answered By - Juri
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.