Skip to content
Ryan Mark edited this page Oct 13, 2011 · 29 revisions

MTV is a plugin for WordPress that provides a new API for developing plugins and themes. Born out of frustration with the undocumented, inconsistent WordPress API, MTV provides a simple, familiar, consistent way to develop heavily customized WordPress sites.

MTV borrows a lot from existing MVC-style frameworks, namely Django and Backbone.js. If you're familiar with those frameworks, you should feel at home using MTV. If you're not familiar, go try some tutorials. It'll make you a better programmer.

This plugin hijacks and takes over how WordPress handles URLs and templates, and gives you new ORM-style tools for handling posts, users and blogs. This plugin does nothing by itself, and (hopefully) will not break stuff that you already have. It's just a set of tools for developers to use.

Getting started

  • Bare MTV
  • My first theme

The model layer

  • Basics of Model, ModelCollection
    • syntax
  • WordPress Models and ModelCollections

The view layer

  • urls.php
  • Including urls from other places
  • Writing a view

The template layer

  • Available wp template functions
  • How to add a template functions, tags, filters
  • Deep links to twig

AJAX

  • Setting up ajax urls
  • Writing an ajax view
    • Calling ajax
Clone this wiki locally