FuelPHP application with Backbone.js model.save()

Tweet about this on TwitterShare on Facebook0Share on LinkedIn0Share on Google+0

Backbone.emulateJSON = true;

I’ve working on a FuelPHP web application with Backbone.js and encountered an issue where model.save() sends a wierd dataset to the server.

That code seems perfectly fine, but the sent data is ..

What!? How come the whole object turned into a key of the sent object?
I was totally lost for 3 and an half hours.. Then, got the answer!

This convert the obj to this.

Happy :)

json_decode(Input::put(‘model’));

Now, move on to FuelPHP REST controller. The sent object data (Input::put(‘model’)) need to be decoded by “json_decode()”;

What a annoying staff! Happy though :)

Leave a Comment.