Search code examples
joinmodelsphalconhas-manyvolt

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


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 %}