ejs layout

express 3.x 中使用ejs的模版比较麻烦一点,但是还是很容易的。
已经不支持layout功能了,用include实现,更强大了。

Currently EJS has no notion of blocks, only compile-time includes, however you may still utilize this feature to implement "layouts" by simply including a header and footer like so:

<% include head %>
<h1>Title</h1>
<p>My page</p>
<% include foot %>

  

 

posted on 2013-09-18 14:11  wssdzf  阅读(285)  评论(0编辑  收藏  举报

导航