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

{% extends ,.....%} How to write??

I create a volt,it extends the base.volt {% extends '../../../../tpl/user/default/public/base.volt' %} But I wan't to write the long string,So i $this->view->setVar('USER_TPL','../../../../../../tpl/user/default/');in the controller, I don't how to use the USER_TPL in the {% extends ,.....%} How to write?? thank you!!!



33.8k

Did you tried {% extends USER_TPL %}?



9.6k

Did you tried {% extends USER_TPL %}? en I tried,It's false.

For what reason u are putting your templates in directory public and not within the views directory ???

For example, if your base.volt are in directory views/templates you extends like {% extends "templates/base.volt" %}