Hi,
I don't know how dev team plans to organize views (views folder) in new 2.0 framework, but I remember some suggestions to 1.1 branch to clearly separate layouts folder from views folder.
Current implementation not only disallow to have layouts set of views for example for LayoutsController (which might be necessary for many more complex projects). It also introduces some disorganisation, especially in large projects, with many controllers and views.
I don't know what are others' opinions on that, but I would strongly support the idea to move protected/views/layouts to protected/layouts folder.
Regards,
Trejder
Page 1 of 1
Views organisation
#1
Posted 13 September 2011 - 05:12 AM
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
#2
Posted 13 September 2011 - 06:07 AM
disagree
because every module can have a layout and protected/views/layouts is the layout of the default "module"
because every module can have a layout and protected/views/layouts is the layout of the default "module"
#3
Posted 13 September 2011 - 09:43 AM
I don't see a problem with current implementation. First of all, it's better to name controllers in singular so LayoutController, not LayoutsController. mbi's argument is also valid.
Yii 2.0 Development Cookbook
Enjoying Yii? Star us at github
Support me so I can work more on Yii: https://www.patreon.com/samdark
Enjoying Yii? Star us at github
Support me so I can work more on Yii: https://www.patreon.com/samdark
#4
Posted 28 September 2011 - 06:13 AM
I don't follow you, but this might be caused by my lack of knowledge and experience in using modules (a rather new thing for me).
@mbi: What would be the problem with having "default" module layouts kept in protected/layouts and for particular module in protected/modules/name/layouts?
@samdark: If we're going down to organisational and naming part, I would rather say that I would use LayoutController (singular) for implementation of all actions related to currently selected by user layout and LayoutsController for implementing operations on group of layouts, like adding, removing, configuring etc. But I agree that this purely organisational case and your solution is also OK.
@mbi: What would be the problem with having "default" module layouts kept in protected/layouts and for particular module in protected/modules/name/layouts?
@samdark: If we're going down to organisational and naming part, I would rather say that I would use LayoutController (singular) for implementation of all actions related to currently selected by user layout and LayoutsController for implementing operations on group of layouts, like adding, removing, configuring etc. But I agree that this purely organisational case and your solution is also OK.
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
Share this topic:
Page 1 of 1