Volt issue- array keys must be always a string...
Hi there :)
Today i find something wrong with volt (or i think is wrong), so let u show u by example (in volt template):
{% set weekdays = [1: 'Monday', 2: 'Tuesday'] %}
This example will NOT work- return error: "Phalcon\Mvc\View\Exception: Syntax error, unexpected token COLON".
I notice smnth- this example will work only when the keys are strings, like: ['1': 'Monday', '2' ...].
Is it normal that behavior?
phpinfo : Phalcon version is : 2.1.0r on PHP 5.6.3 (windows build)
Thank u :) Have a nice week!
@butamuh4o Could you please provide script to reproduce (use case)?
Hi @sergeyklay and thanks for respond :)
Well... i am not sure what u mean by that (because that is all script u need, or i dont understand (sorrry)), but... just add in some of your volt templates this line:
{% set weekdays = [1: 'Monday', 2: 'Tuesday'] %} - and u will notice respond of error. But if u modify keys and put them in quotes (like {% set weekdays = ['1': 'Monday', '2': 'Tuesday'] %}) - will work.
Thats all :/ if it is need, i will do more to describe the issue, but for now i cant understand what (sorry about it).
Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues