TOPICS

FIND YOUR TOPIC QUICKLY

PHP MVC Frameworks

Sep 25 2008

Keith Medlin

There are at least 20 PHP MVC frameworks and trying to break each one down into its component strengths and weaknesses would be foolish.  Each one tries, on some level, to outdo the others through the combination of features catering to some niche audience.  Having been a consumer of everything from Code Igniter to Zend Framework and beyond I can honestly say that no single PHP framework is the “best” or is even deserving of such a title.

Had Ruby on Rails not had the major failing of deployment early on I think PHP wouldn’t have seen the proliferation of such frameworks.  Mojavi and Zend were already working on their MVC frameworks when Ruby on Rails truly took off.  Both frameworks have a great foundational premise.  In the case of Zend they are the PHP company and their framework is built around the optimization of that language for rapid application development (RAD).  For Mojavi, on the other hand was an early adopter to see the problems inherent in many PHP application lifecycles.  Mainly that application maintenance and modularization was difficult to handle.  Mojavi’s develop arose from a specific need in that sense.

After Ruby on Rails was released there was a rush to launch Ruby on Rails for PHP.  Ruby on Trax, CakePHP, Symfony (to a lesser extent), Akelos, and Code Igniter all gained real development momentum and fame on the coat tails of Ruby on Rails’ success.  I would hardly suggest that these frameworks are bad for trying to bring solid theory from Ruby on Rails to PHP.  In fact, I believe it added a significant library of successful implementations of web application development tools for PHP developers.  Each one features, as I said, largely the same code and basic functionality.

Symfony, however, was an early leader.  Their integration of Mojavi, YAML, Propel, and a myriad of other existing technologies meant they had a clear functionality lead as well as a fairly complete set of documentation.  The Symfony team recognized early on that documentation would win this battle and would drive 3rd party plugin support that helped make Ruby on Rails and other frameworks widely accepted.  Throughout the 1.0.x development Symfony largely followed the widely accepted MVC framework standards.  When 1.1.x was announced many people thought this might be the upgrade that would establish a single dominant PHP MVC framework.  Then the train went off the tracks so to speak.

Symfony’s lead developer announced sweeping changes to how forms, validation, and MVC would be interpreted by their framework.  No longer did developers and designers deal with the view code to build forms.  They would now be splitting their time between the view and the controller.  This blurring of the roles of the MVC philosophy was a clear break with people’s expectations and was complex enough that a new book covering solely building forms in Symfony was announced.  The lead documentation and partner within the Symfony project then announced he was leaving.  At this writing, 3 months after the launch of 1.1.x there is still no upgrade to the documentation on forms and no word about the forms book.  In my opinion, the upgrade from 1.0.x to 1.1 killed Symfony as a viable option for PHP frameworks.

CakePHP, at the same time, was moving from their largely undocumented 1.1 version into a more Rails-like 1.2 version that promised better promotion and documentation.  Code Igniter’s Expression Engine caught fire ;) and Zend began pushing for more user-centric documentation through a website redesign focused on getting new users into their framework.  The fallout is that while we’ve eliminated a major player from serious consideration for the PHP MVC “best” title there are no clear winners and losers.  Even Symfony still has its fans through all their turmoil.

A solution would be the endorsement of one of the major frameworks by other less popular open source projects.  For example if Akelos put their development efforts behind cakePHP or Code Igniter in some way to bolster those frameworks.  There are too many PHP MVC tribes right now splitting up teams that could drive innovative features by encouraging a market where talent is largely spread thin.  Ruby on Rails, on the other hand, has focused their efforts and attracted more talented individuals to contribute.  The net effect is that PHP stands at a crossroads in terms of the usefulness of pursuing a single MVC or framework structure at all.

Many people have begun to realize how useful custom development frameworks can be.  Further, they can pick and choose their favorite libraries or even incorporate them into homegrown frameworks.  This, again, further fractures the PHP community working to create a powerful MVC solution for developers stuck in environments that cannot support yet another language beyond PHP.

In the end, I believe it is still too early to call PHP out of the game.  The language still holds sway in terms of support from the vast majority of affordable web hosting shops.  Likewise, the barriers for entry are extremely low for PHP and as Ruby on Rails increases functionality it is becoming less accessible daily which means a longer and steeper learning curve for new developers.  I am looking forward to the next 36 months as I believe that we’ll see a clear winner in PHP emerge during this timeframe as projects that gained initial momentum from Ruby on Rails’ widespread acclaim in 2005-06 lose their steam and fold forcing talented developers to choose a new framework.

3 Responses to “PHP MVC Frameworks”

  1. Wil Sinclair


    I actually believe there will never be a ‘clear winner in PHP’, and that is a very good thing in my opinion. Every framework has it’s strong points. CodeIgniter focuses on performance and PHP4 compatibility, CakePHP focuses on ease of use, PHP 4 compatibility, and bringing the best ideas of RoR to the PHP community, and Symfony focuses on providing components out-of-the-box and plugins that will significantly speed up development of a project, as well as offering the best features in PHP 5. While I might not be 100% accurate on the intentions of these project, as the manager of the Zend Framework team here at Zend, I can tell you about our focus with a bit more authority :) : we are developing a framework that uses all the great features available in PHP 5, provides as much flexibility and extensibility as possible, encourages best practices, and gives PHP developers a set of use-at-will components so that they can opt for other technologies if they prefer them to Zend’s solution in certain functional areas. We have had to trade off some simplicity in pursuing these goals, but we are building up to the simplicity offered by the projects mentioned above very quickly.
    BTW, I would certainly not write of Symfony. I know they have had some challenges around the 1.1 release timeframe, but there are still plenty of Symfony users/lovers to whom Symfony’s value proposition remains extremely strong. This project is under very active development and is still innovating in the PHP space.

    ,Wil

  2. Keith Medlin


    Thanks for your thoughts Wil. I actually think ZF is fantastic for exactly the reasons you mention. I know that it integrates VERY well with Symfony so for those folks who aren’t keen on some of the 1.1 direction that Symfony has taken there is always the possibility to pick and choose since Symfony is largely a mashup of existing well established technologies.

    In terms of the “clear winner” argument though I definitely believe that to some degree if the smaller frameworks with infrequent updates would fold it’d add a new influx of talent to established frameworks and through the particular tastes, etc. those folks were bringing to other projects collectively make the PHP framework scene better.

  3. Wil Sinclair


    True, consolidation of frameworks is likely to occur as authors of some frameworks come to the conclusion that their efforts will have more impact as contributions to another, possibly similar and/or more popular, framework. But then we’re talking about a ‘clear winners’ argument, as it is extremely unlikely that any one project will fit the needs of all projects and development styles.
    BTW, I like your use of the Taliesin West pic. It’s one of my favorite buildings.

    ,Wil

Leave a Reply





You can use basic HTML styling tags such as bold or italics. Other markup will be removed when you submit your post.

RECENT COMMENTS




  • ON...CakePHP 1.2 File Upload
    "Fixed it! Thanks for the heads up Jose."
  • Keith Medlin
  • ON...CakePHP 1.2 File Upload
    "Thanks a lot for the example. Just another typo/error in the tutorial : var $validateFile = array( ’size’ = 204800, should be: var $validateFile = array( ’size’ => 204800,..."
  • Jose Sanchis