Javascript – DOM – Convert XML DOM object to friendly array.

Use this simple javascript function to convert any loaded xml string to a hash/array format variable.
var toDOM = function(node, obj) {
node = !node.nodeName ? (new DOMParser()).parseFromString(node, “text/xml”).firstChild : node;
obj = obj && obj != ‘undefined’ ? obj : {};
if (!node.nodeName || node.nodeName == ‘undefined’) return(obj);
if (node.attributes) {
for (var i = 0; i < node.attributes.length; i++) …

CakePHP Helper – the fetcher, what we all need, as simple as it is

Sometimes you encounter a place where in a view you need to intiate a model and fetch some information, requestAction is not recommened and currently CakePHP provide a simple way to fetch a model data.

so how can it be done, easily we had made the Fetcher helper that can help you get link, news, users …