视图工具的问题:app.helpers
发布于 11 年前 作者 dcminicode 4315 次浏览 最后一次编辑是 8 年前

enter image description here

enter image description here

为什么会出现这个问题,是在ejs的新版本中移除了这个方法吗?我是在看nodejs开发指南学习,如果是版本的问题,不知道那位高手能给个现在版本的技术文档地址,有劳了?

5 回复

新的版本中移除了。可以使用

 app.locals()

那动态函数app.dynamicHelpers也没了?改成什么了?大神顺便发个文档地址给我吧,我可以自己查,我没在网上找到

Migrating from 2.x to 3.x
https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x

New features in 3.x
https://github.com/visionmedia/express/wiki/New-features-in-3.x

@dcminicode 中间件加 locals 能举个例子么?

回到顶部