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

How to join variable in string use Volt template

Hi, I have a declared value in the controller named: {{ themeUrl }}. I want to Join this variable to string in Volt template it works well with php: <?php $this->assets->collection('footer')->addJs($themeUrl.'/js/icheck.min.js');?>

But with Volt tempalte is Error: {% do assets.collection('footer').addJs({{ themeUrl }}'/js/icheck.min.js') %}} Please help me



3.3k
Accepted
answer

The ~ concatinates strings in volt and you have too many curly bracers around themeUrl

addJs(themeUrl ~ '/js/icheck.min.js')

Yes, thank for so much