How to use multiple layout within a SailsJS app?

前端 未结 5 731
盖世英雄少女心
盖世英雄少女心 2021-02-15 13:16

My Sails.js application have separate frontend and admin layout. My view engine is ejs.

How do I use separate layouts for frontend

5条回答
  •  无人共我
    2021-02-15 13:40

    In Sails 0.10 you can set a different layout like this in your controller:

    // override the layout to use another
        res.locals.layout = 'layouts/layout2';
        return res.view('test');
    

    Detailed explanation here.

提交回复
热议问题