Yii Framework Forum: Views organisation - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Views organisation

#1 User is offline   Trejder 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,193
  • Joined: 06-October 10
  • Location:Southern Poland

Posted 13 September 2011 - 05:12 AM

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
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
1

#2 User is offline   mbi 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 604
  • Joined: 08-May 09

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"
3

#3 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,387
  • Joined: 17-January 09
  • Location:Russia

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 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#4 User is offline   Trejder 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,193
  • Joined: 06-October 10
  • Location:Southern Poland

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.
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users