Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在motor.js中设置基础模板?_Html_Locomotivejs - Fatal编程技术网

Html 如何在motor.js中设置基础模板?

Html 如何在motor.js中设置基础模板?,html,locomotivejs,Html,Locomotivejs,我不想在项目中的每个视图上设置我的资产(CSS/JS、菜单等)。有没有办法设置一个基础模板,然后调用视图来填充它的主体 例如: <!-- my base template --> <html> <head> <!-- my assets here --> </head> <body> <%= view.render() %> <!-- example

我不想在项目中的每个视图上设置我的资产(CSS/JS、菜单等)。有没有办法设置一个基础模板,然后调用视图来填充它的主体

例如:

<!-- my base template -->
<html>
    <head>
        <!-- my assets here -->
    </head>
    <body>
        <%= view.render() %> <!-- example of where I would render the views -->
    </body>
</html>

我怎么能做到这一点呢?

我已经看到了这一点,但还没有看到它是如何工作的。另一个选项是使用EJS partials