Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.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
Templates 扁铁式钢板_Templates_Node.js_Flatiron.js - Fatal编程技术网

Templates 扁铁式钢板

Templates 扁铁式钢板,templates,node.js,flatiron.js,Templates,Node.js,Flatiron.js,我将如何将导航插入html文件,如下所示。(有点像wordpress风格) home.html: <html> <body> (I dont know what to put here for nav) <div main> </div> </body> <html> (我不知道在这里放什么导航) nav.html <nav> <img scr="logo.png">

我将如何将导航插入html文件,如下所示。(有点像wordpress风格)

home.html:

<html>
 <body>
   (I dont know what to put here for nav)

   <div main>
   </div>
 </body>
<html>

(我不知道在这里放什么导航)
nav.html

<nav>
 <img scr="logo.png">
 <ul>
  <li>home</li>
 </ul>
</nav>

那么,我如何在带板的计算机上实现模板呢

注:
我使用的是flatiron、plates、director,plates不支持将html注入另一个字符串的方法

它用于将数据绑定到标记

最简单的解决方案是使用可以按顺序连接的文件来形成所需的页面

例如:

  • header.html
  • 免责声明.html
  • 页面1.html
  • 页面2.html
  • 页面3.html
  • footer.html

选择所需的组件(例如header.html、page2.html和footer.html)后,您可以使用plates将数据绑定到页面标记并将所有内容发送回客户端。

plates确实支持分部,请参阅

还有另一种方法(可能是在板块明确支持分块之前):