[BUG]: Volt Template Engine doesn't support this syntax [for loops]
Describe the bug Volt Template Engine doesn't support this syntax [for loops] NGINX will return a 502 Bad Gateway
{% for key, group in session.loginUserGroupData %}
{{ group['UserGroupName'] }}
{% endfor %}
Details
- Phalcon version: v5.0.0beta3
- PHP Version: php:8.0-fpm-alpine
- Operating System: Windows 10
- Installation type: Docker
- Server: Nginx
If you are referencing to service object "session", I think you should call it from "this." this.session.loginUserGroupData
If session is an object you have in your controller AND you have a service in the DI container for your session called session these two will clash.
First - if session is an object other than the Phalcon\Session\Manager - rename it to something else when you do the setVars() for your view. Then you can call it directly there. Also if loginUserGroupData is a method, it will need the parentheses loginUserGroupData()
Closing this. If the issue persists please open a new one with relevant information