Proper way to use different Layouts for Templates in Phoenix

后端 未结 2 608
被撕碎了的回忆
被撕碎了的回忆 2021-02-15 18:38

Is the proper/simplest way to change the Layout of a Template to use the put_layout method within each Controller action? A simple example of wanting a different La

2条回答
  •  感动是毒
    2021-02-15 19:10

    If for example you need a different layout for say all admin controllers which are covered by separate admin pipeline in the router you can specify plug :put_layout, {MyApp.LayoutView, :admin} for the admin pipeline. I learned it from http://www.cultivatehq.com/posts/how-to-set-different-layouts-in-phoenix/.

提交回复
热议问题