Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将布局文件放在模块/模板(或其他)目录中而不是一般的应用程序/模板中?
我试图把路径放进去,view.yml但它不起作用。
view.yml
刚刚找到了一个解决方法,所以我可以保留layout.php在模块/模板文件夹中:
layout.php
public function preExecute() { $template = $this->getContext()->getConfiguration()->getTemplateDir('MODULE', 'layout.php'); $this->setLayout($template . '/layout'); }