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 use a dynamic value to load template

Hi,

How can I use a dynamic value to load template eg.

{% include site['theme'].'/header' %}

I keep getting an error.

Thanks



93.7k
Accepted
answer

To concatenate strings in Volt you have to use the ~ sign.

{% include site['theme'] ~ '/header' %}


6.6k