As mentioned in the previous blog, we’re currently deciding how our new project should flow. By this I mean, do we use the more conventional methods we’re used to (hard coding our php for each individual page) or to take the plunge and go the Model View Controller (MVC) route.
I’d decided a few days ago to look into MVC, although i’d touched on this within Ruby on Rails, i’d never done it within PHP. After some initial research, it seemed that this wasnt as complex and as far fetched as I initially though – therefore worth a look in my opinion. With help from online tutorials and people in the know of MVC frameworks, i worked through and created a simplistic framework that worked with the “Smarty” templating system, which was also then tied in with PEAR::DB for database abstraction.
I created a few simple functions, simply passing data throughout our framework to display customer details, and then change this depending on search critera. Not exactly complex, because this is easy to do with in PHP anyway, but the thing that struck me was, suddenly im not repeating code, and things are beginning to look more logical; in the way that I know exactly where I have to go to edit files, I know exactly what page does what, and the whole process seems to flow in controlled manner. This seemed a plus point for me, and I thought we may be onto a winning idea.
A brief meeting was then held between myself and Adrian who talked over this aproach; we also consulted Dave (briefly), Jake and Gregg and Senokian for the expertise in MVC Frameworks.
Their opinions were mixed, there were plus points and downsides to the idea we had, the main downside thats stuck in both our heads is the learning curve it may cause to fully understand how this MVC will work, and how we can train someone else if they needed to.
The opinions of Jake and Gregg at Senokian basically stated that it may not be a good idea for us to go down the MVC aproach due to the learning curve that would be needed by myself in order to get upto standard, but if we did decide to go down that route, and i felt comfortable in aiming towards using MVC then there are numerous frameworks we coulc use, such as smarty.php.net.. This basically allows us to create the design quicker, and perform template swaps/alterations all in one place.
This has brought some confusion between us, because Gregg and Jake have a lot more experience with MVC frameworks than me, so I have to take their advice, and have to admit im really in two minds now
My opinion now is to spend a few days trying to work with this framework, and come up with some useful functionality. If i fall into problems then we may need to give the MVC approach a miss, but if things work how we expect them, this may be an area we need to solidly look into.