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.

variable in include Volt template

Hi,

I am new to phalcon and was trying to make a widget page with the volt template engine. When i do {% include "widgets/main/personal.volt" %} the personal widget will be loaded, but when i do {% include widget.widgeturl %} i get the error that my volt template doesn't exist. (the widget.widgeturl gets from a mysql database.) wamp\www\public/../app/views/widgets/main/personal.volt' was not found in the views directory

is it possible to use these variables with a include or do i have to use an other option?

Greets, Vincent



82.2k
Accepted
answer

Hi, the template name in widget.widgeturl must not contain the .volt extension that's why the partial cannot be loaded

Thanks, it works. I like the writing style of phalcon clean and fast :)



443

It will be good to document this somewhere, because it is very much not obviouse!

https://docs.phalconphp.com/en/latest/reference/volt.html#include How more obvious should it get? ;]

It will be good to document this somewhere, because it is very much not obviouse!