I want to create a custom wordpress plugin. I want to use backbone.js. I have used backbone for non php/wordpress related projects. Can someone guide me to how to go about writing the plugin to make use of the mvc client side architecture? Thanks!
-
I would be very grateful if somebody could give me some sort of direction! – AntoineDeSaintExupery Jan 12 '12 at 00:19
2 Answers
I just pushed WordpressSinglePage, a starting place for building single-page JavaScript applications on top of Backbone.js via Brunch (Backbone.js, CoffeeScript, EcoTemplates, jQuery --http://brunch.io/) and the Wordpress JSON api. This should get you on the right track.
Updated link: https://github.com/damassi/WordpressSinglePage-JavaScript
My belief is that since backbone.js is a client side framework the bulk of the complexity is going to be in writing the actual plugin. Smashing Magazine has a great article "WordPress Essentials: How To Create A WordPress Plugin" that should serve as a good starting point. Outside of that I would look at the discussions about "Backbone.js How to use with PHP" here on StackOverflow.
"If you're doing #PHP and need a RESTful API (for #BackboneJS, etc) the #SlimPHP framework looks pretty slick. It's like #Sinatra for PHP." Derik Bailey

- 1
- 1

- 1,356
- 2
- 14
- 23
-
thanks a lot dude. I used backbone that runs from model served by a wordpress plugin. I will use #SlimPHP to serve me the model. – AntoineDeSaintExupery Feb 08 '12 at 18:35
-
you may want to take a look a this colorLabs project http://www.wpmods.com/backbone-wordpress-theme-framework/ – Gabo Esquivel Mar 17 '12 at 17:13