Node.js express: confuse about ejs template

核能气质少年 提交于 2019-12-01 09:18:05

Ahah you just got tricked by Express 3 change in layout management. The official example: https://github.com/visionmedia/express/tree/master/examples/ejs Has not been updated.

In Jade you now have to use blocks and extend the layout. http://www.devthought.com/code/use-jade-blocks-not-layouts/

Try to use ejs-locals then you can do this in a login.ejs file:

<% layout('layout') -%>
<form></form>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!