We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

define anonymous functions inside volt

Hello,

There is possible to write php anonymous functions inside volt? something like

{{ widget.render("GridView", [ 'data': function($model){return $model->getTitle()}]) }}

Thanks

edited Mar '16

I guess not and there shouldn't be, views are not for putting logic into it. Just add custom function to volt if you need it.

edited Apr '16

well, is not really meant for putting logic into it, but more to pass the value as a function and on server I can pass anything I want on that $model. Just being curious if there is something part of volt before I try to implement something myself.