javascript - How to modify the template directory using nunjucks?
PHP中文网
PHP中文网 2017-05-31 10:41:29
0
1
651

The default configuration on the official website is

nunjucks.configure('views', { autoescape: true });

The template directory is under /views. If I want to change it to be under group directories such as /views/admin and /views/home, can this be achieved through configuration? Or do I need to modify the render method?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all (1)
阿神

If the framework provides middleware, you can intercept it in the middleware, then identify whether it is a front-end module or a back-end module, and finally configure dynamic nunjucks

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!