Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure the folders in APP/View #1975

Closed
ghost opened this issue Oct 11, 2013 · 10 comments
Closed

Restructure the folders in APP/View #1975

ghost opened this issue Oct 11, 2013 · 10 comments
Milestone

Comments

@ghost
Copy link

ghost commented Oct 11, 2013

Created by Florian Krämer, 11th Jul 2012. (originally Lighthouse ticket #3025):


Having the views template folders at the same level as the view classes and helpers feels somehow not well organized and you can end up mixing regular view files with helpers in the case you have a HelpersController and by this a view for it.

I would propose to change this to:

Instead of having APP/View/<Controller> I propose APP/View/Template/<Theme>/<Controller> for plugins I propose APP/View/Template/<Theme>-<PluginName>/<Controller>

As you can see I would also drop the separation between the "normal" view level and theme views. It felt always a little odd to me that views outside of a theme got a special "app" level role.

@ghost
Copy link
Author

ghost commented Oct 11, 2013

11th Jul 2012, Mark Story said:


What if there is no theme? Also couldn't we also move view + helper classes somewhere at the same level as App/View instead of making more deeply nested directories? Or just have App/Template and App/View/Helper.

I personally would like to see theme's just go away, and just become plugins. But I think that is a parallel discussion to this.

@ghost
Copy link
Author

ghost commented Oct 11, 2013

11th Jul 2012, Florian Krämer said:


I agree about the nested folders. I also thought about APP/Template, would be a good alternative.

When there is no theme specified it would use the default theme like APP/Template/default.

If themes become plugins (pretty confusing IMO) we will need to provide a simple way to link their assets to the webroot.

@ghost
Copy link
Author

ghost commented Oct 11, 2013

11th Jul 2012, Mark Story said:


There are a few benefits of having plugins == themes

  • You can have them contain helpers.
  • They can contain view classes.
  • They can contain utility libraries.
  • There are no more questions about how to put themes inside plugins. As they are plugins.

Requiring a default directory seems a bit arbitrary and an extra constraint to facilitate themes, which are already kind of kludgey and limited in a few aspects. Converting them to be plugins removes constraints and mostly solves this problem as well.

@ghost
Copy link
Author

ghost commented Oct 11, 2013

11th Jul 2012, Florian Krämer said:


This would be ok as well, but I don't like the idea of mixing themes with other plugins in the same directory. So why not use APP/Template or APP/Theme for that?

@ghost
Copy link
Author

ghost commented Oct 11, 2013

11th Jul 2012, dogmatic69 said:


Having themes as a standalone "plugin" seems like a nice idea.

You can easily App::build() a new dir to act like a Plugin dir. eg:

App::build(array('Plugin' => array(APP . 'Themes')));

@ghost
Copy link
Author

ghost commented Oct 11, 2013

11th Jul 2012, Florian Krämer said:


I'm aware of that possibility but having it APP . 'Theme' (why plural?) available would make it obvious even to the less aware people. But there is still the problem that you'll have to do something manually to get the themes assets copied or symlinked to the webroot dir. If not they'll all go through the dispatcher.

@ghost
Copy link
Author

ghost commented Oct 11, 2013

11th Jul 2012, dogmatic69 said:


The problem of symlinking assets for plugins too. You can not have more than one webroot for a server vhost, and plugin theme assets are generally self contained. I doubt there is any way around this besides symlinking them manually. Its not to hard to script it up and make it part of your install / deploy anyway.

@dereuromark
Copy link
Member

Is is resolved with 3.0 and themes/plugins being unified?

@markstory
Copy link
Member

I think so, but the work to combine themes and plugins has not yet been completed.

@lorenzo
Copy link
Member

lorenzo commented Jan 23, 2014

We already have a ticket for making themes into plugins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants