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?

Thanks



7.1k
Accepted
answer

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



10.6k

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



7.1k

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