I write modular app and want common path (Volt layouts) for all modules.
$view->setLayoutsDir(PATH_APP . '/common/layouts/'); // don't solved problem
{% extends "../../../common/layouts/base.volt" %} // so ugly
{% extends common_layouts ~ "base.volt" %} /* return error
"Syntax error, unexpected token IDENTIFIER(common_layouts)..." */
P.S.: not forgotten about:
$view->setVar('common_layouts', PATH_APP . '/common/layouts/');`
Do u have solution?
look here for backup view path - I think that might help in your situation.
You will need to use just
"default.volt"
instead of realtive paths.Btw, in your 3rd solution you can use
{{ partial(comm_layouts ~ 'base.volt') }}
.