Hey everybody, I've been working with PHP for a few months now and have come pretty far... and am starting some pretty big projects using Object-Oriented PHP design patterns.
I've learned a bit about the Model-View-Controller and decided to sort of make it with twist. Before I started implementing it in several big apps, I was wondering if anybody could give their opinion if they think it's good... anyway, here's a quick run down.
My php apps use a MVC design pattern. The top dog of the application which practically controls every aspect is a php class called the AppController, which is instantiated by going to a php file (example- someting.com/app.php). Upon creation of an AppController, it automatically grabs and processes all variables passed in the URL - it analyzes the names and values and uses an extensive branching of switch/case structures to figure out what needs to happen.
Once the request is processed, the AppController will create a DataController and a ViewController. DataController calls the "model" classes (for example - article.data.php would be a ArticleData class which will retrieve all data for a blog article) and returns the data to the AppController. When this data is returned, AppController uses teh ViewController to generate the final HTML/CSS/etc page. ViewController is passed the data from DataController and then calls on a "view" class (example - article.view.php) that is a mix of php code and html which will insert the dynamic data from DataController.
So, do you think this is a good way to develop really big apps (like a project management app that might be 10,000 + lines of code)?
I've used it on several medium-sized apps and find it awesome - it seem very quick and easy to manage. Plus, I can reuse the App,Data,ViewControllers (just change some of the logic and function/variable names). THe only thing I need to uniquely create are the data model classes (not hard at all) and the view classes (which is usually copy+paste HTML from the mockup template and a bit of data injection here or there.
Is this a good approach? Efficient at runtime? Thanks for the advice. I greatly appreciate it :)