/nunjucks的具体配置handle:nunjucks},ejs:{//ejs的具体配置handle:ejs,viewPath:path.join(think.ROOT_PATH,'view/ejs
:{handle:nunjucks,beforeRender:()=>{},//模板渲染预处理options:{//模板引擎额外的配置参数}}} 这里用的模板引擎是nunjucks,项目中可以根据需要修改
nunjucks模板引擎的参数顺序由原来的preRender(nunjucks,env,config)修改为beforeRender(env,nunjucks,config)。
查看配置详情 Controller和View(nunjucks) Controller 如果需要再controller里面获取I18n的实例或者当前的locale,可以调用 asyncindexAction