Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Request for demos with PHP & MySql stack #114

Closed
amite opened this issue Apr 22, 2012 · 5 comments
Closed

Request for demos with PHP & MySql stack #114

amite opened this issue Apr 22, 2012 · 5 comments

Comments

@amite
Copy link

amite commented Apr 22, 2012

Hey addy,

Would do people working with CMSs like me a lot of good if you could show us how to use backbone with a non-rest based server

@addyosmani
Copy link
Owner

Would it be okay if this was done with Zend?

@amite
Copy link
Author

amite commented Apr 28, 2012

ok I guess. I just want to see how to collect and parse a put and delete request from a normal form via backbone.

What I want to see is:

  • How do I rewrite the Sync method?
  • What happens when you turn emulateHTTP off or on?
  • How do I insert, update and delete data from a mysql database based on the incoming request body?
  • What do I return back to my backbone view, router or collection after I am done parsing?

Would love to see these topics covered in your work on backbone. People like are me are still trying to shift from our old ways of ajax requests and non-rest based servers to this new world. These answers will help us make the transition.

@addyosmani
Copy link
Owner

We potentially could use this as a starting point: https://github.com/addyosmani/php-backbone-todos. It's based on the same Todo application my TodoMVC project and some of the rest of the book is. What's missing at the moment are proper sync, demonstrate of emulateHTTP off/on.

With respect to the last point you mention (what to do when parsing), could you be a little clearer? Typically when you're done parsing the data for a model/collection, you just return the portion of the object requested (e.g JSON response) you're going to work with.

As with how this would work with put and delete, in my opinion this doesn't really change from how you would handle it in a Backbone-less application (i.e maybe put and delete requests just return a validation message from your backend saying whether the request has correctly gone through or not).

@amite
Copy link
Author

amite commented Apr 29, 2012

Addy,

The github project you point to is using the slim server that's rest-based. Although this could no doubt be interesting, a far more urgent case is people working with CMSs like wordpress and expressionengine who are tasked with creating custom front-end applications with the data in the CMS database.

So showing us how to do data modeling within the constraints of a vanilla PHP and MySql setup would be great. You do attempt to show this in your earlier photogallery tut on backbone and friends but the server code there doesn't seem to be production quality and it's also quite confusing.

As for the last point about parsing, please ignore it - you seem to have clarified it in your reply.

@addyosmani
Copy link
Owner

Based on the feedback on the book so far, the indications are that most people would like less of a focus on the restful apps side of things and more clarity on using Backbone.js itself. With that in mind, I may consider scaling back that part of the book or moving it into a later project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants