We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Integer to string

HI all,

how can i pass an int to a template? VOLT converts it to a string and numeric comparisons fails without a type casting. Is there any workaround?



You can define user function in Volt for any conversion of your data. http://docs.phalcon.io/en/latest/reference/volt.html#id3


Thanks for your answer! Is this the expected behaviour? Why?


Volt - extensible compiler. It has any standard functions, and you can extend it with any function.