Common layouts for modular app

590 views Asked by At

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?

1

There are 1 answers

0
jodator On

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') }}.