Welcome Guest, Not a member yet? Register   Sign In
MVC paths to folders alternative
#2

(01-06-2017, 04:34 PM)MickDuprez Wrote: Hi All,

While I'm quite happy with the MVC pattern I'm wondering if it's possible to set up file pathing so that all files related to a 'page' say are in the one folder.
That is, I'd like to place my model, view and controller files in one folder rather than all controllers in the controller folder and so on.

I like this idea as I can easily grab a folder from an existing project and add it to a new one and have it ready with just a few changes to suit that project.

I would still have partial views such as header and footer files in the core part of the app but I'd like to have content in separate directories like so:

application
       |_> login
       |_> products
       |_> blog
               |_ blog_controller.php
               |_ blog_model.php
               |_ blog_view.php
      |_> home

Is this possible in CodeIgniter?

I have toyed with this while building my own frameworks for learning but I'd like to move to CodeIgniter as I like the way it works and this would be the icing on the cake Smile

If you think this is a bad idea I'm genuinely interested in your thoughts on this.

Thanks for your time,
Mick

Your structure looks ok. Something similar I use too.

But these days I am experimenting with a different structure. I prefer every controller to serve one HTTP-request only, normal or AJAX. This seems to me more easily maintainable. See the attached image - it is about a CRUD-module within a panel for administration.

I am not suggesting anything, just sharing a thought.

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
MVC paths to folders alternative - by MickDuprez - 01-06-2017, 04:34 PM
RE: MVC paths to folders alternative - by ivantcholakov - 01-06-2017, 05:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB