Monday, July 27, 2009

Zend Framework, dojo and Json

I have already written about json in one, actually some of my articles. Cool functionality can be achieved using json. Thanks to http://www.json.org, http://www.zend.com and http://www.dojotoolkit.org for provide easier solutions.

I'm not gonna talk what these three are all about, but instead share a little secret about these.
Json creation in dojo is as simple as this.
var arr = new Array();
arr[0] = “apple”;
arr[1] = “ball”;
arr[2] = “cat”;

dojo.toJson(arr);


Using Zend to convert array into json took only one line of code.
Zend_Json::encode($arr);

And decoding- converting json to array, is as simple as this
Zend_Json::decode(json_string);

5 comments:

  1. I dont understand, some of your post are really good but this.. I simply dont understand

    ReplyDelete
  2. Hm, but how about encode from dojo? Have a solution?

    ReplyDelete
  3. Programming in Zend framework itself is suitable for creating complex projects. I am more a supporter of activities that operate in the cloud and I have access to them from many points. If You check services one of the companies that created the application for me, for sure You no need longer other solutions.

    ReplyDelete
  4. Thanks for this very useful info you have provided us. I will bookmark this for future reference and refer it to my friends. More power to your blog.

    B17 MPCHS Islamabad

    ReplyDelete