Welcome Guest, Not a member yet? Register   Sign In
Controllers inside sub folders
#1

[eluser]DLhendup[/eluser]
I am developing a site that has many modules. for eg. yellowpages, news, blogs etc. and they would be organized in the following way:
www.site.com/yellowpages
www.site.com/news
www.site.com/blogs

Can anyone please tell me if it's okay to arrange controllers in folders, like as follows:

controllers/yellowpages/category/add

In the above, "category" is a controller and not a method. "add" is the method and Yellowpages is a subfolder under controllers, and is a module.

controllers/news/view
controllers/news/add
Likewise, news is just a folder and not a controller.

So, will the above folder arrangement work, or do I have to store all my controllers in the controller folder itself? What if I have a controller by the name of "yellowpages" inside the controller main folder? Will it clash with the subfolder by the same name?
#2

[eluser]CroNiX[/eluser]
Sure you can. I think you can only have 1 subfolder deep though for controllers. Don't remember for sure. I do the same thing for my views and create a folder in the view folder named after the controller that the views belong to.
#3

[eluser]DLhendup[/eluser]
Thanks, I tried it out and it's working smooth. May be I should make sure I dont give same names to subfolders with already existing controllers with the same names in the applications folder root.
#4

[eluser]InsiteFX[/eluser]
Check out HMVC in the WIKI.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB