tags:

views:

372

answers:

2

Some people consider WordPress a blogging platform, some think of it as a CMS, some refer to WordPress as a development framework. Whichever it is, the question still remains. Is WordPress MVC compliant?

I've read the forums and somebody asked about MVC about three years ago. There were some positive answers, and some negative ones. While nobody knows exactly what MVC is and everybody thinks of it in their own way, there's still a general concept that's present in all the discussions.

I have little experience with MVC frameworks and there doesn't seem to be anything about the framework itself. Most of the MVC is done by the programmer, am I right? Now, going back to WordPress, could we consider the core rewrite engine (WP_Rewrite) the controller? Queries & plugin logic as the model? And themes as the view? Or am I getting it all wrong?

Thanks ;)

+2  A: 

As already mentioned in the comments, MVC is an architectureal design pattern, not a specific framework, and no, Wordpress doesn't follow the MVC pattern.

There is a separation of views (templates) from the programming logic, but only in the frontend, not in the admin panel and a general separation of views and application logic is not inevitably MVC. An implementation of the MVC pattern usually assumes some kind of object oriented programming paradigm behind it and Wordpress is mainly implemented in a procedural way, with plain SQL queries in the PHP functions, therefore not having an actual model either.

Daff
+3  A: 

Wordpress itself is not architected in MVC, but one can build very MVC oriented themes and plugins within the framework. There are several tools which can help:

WordPress MVC solutions:

Churro: @ wordpress.org extend /plugins /churro

Tina-MVC: @ wordpress.org /extend /plugins /tina-mvc

Plugin Factory: @ wordpress.org plugin-factory

MVCPress: http://mozey.wordpress.com/2007/01/22/mvcpress-screenshots/#comment-3634 (abandoned, but interesting ideas)

MVC threads on WordPress.org Ideas and Trac

  • @ wordpress.org /extend /ideas /topic /mvc-plugin-framework

  • @ wordpress.org /extend /ideas /topic /complete-reestructuring

  • @ wordpress.org /extend /ideas /topic /rewrite-wordpress-using-mvc

  • @ wordpress.org /extend /ideas /topic /wordpress-theme-revamp (more on XSL than MVC)

  • @ core.trac.wordpress.org /ticket /12354 (on MVC in widgets)