Saturday, May 10, 2014

3.0 View VS Template Folders

Having bought up this topic over at GitHub https://github.com/cakephp/cakephp/issues/3458 - I am keen to provide some further thoughts on the new view folder layouts.

Currently, in 3.0, there are two view folders:

View - for view classes, and if I understand correctly, for template engines
Template - for the .ctp files - the "view" files as we know them in Cake 2.x at the moment.

I would like to propose a change to this, IMO, this new set up is a bit confusing.

Having used Cake since version 1.1, the view files have always gone in the View (or views under 1.x) folder.  I would propose we maintain this.

Then, rather than having "View Classes" in the "View" Folder, we look to move these into a new folder.

Looking at other PHP based frameworks, I have some suggestions:

ViewModel (from Zend Framework)
Composers (from Laravel)
Reponders (also from Laravel) - I assume is it called this, as the view classes respond to the controller?

I would recommend Composers or Responders, but also consider coming up with our own term for what these "View Classes" - or Template Engines (from what I understand) are - to create less confusion.

As a second suggestion, I think we should consider a folder set up as follows (if the above idea isn't so popular):

App/View/Template
App/View/Class

So that we have ONE View folder, and then have two folders in there, one for templates and another for the classes.

Look forward to thoughts on this anyhow.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: