fix for xml helper

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4346 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-01-29 22:04:26 +00:00
parent bfc5168358
commit f77e642f24

View file

@ -207,10 +207,10 @@ class XmlHelper extends AppHelper {
* @return string XML
*/
function __composeContent($content) {
$out = '';
if (is_string($content)) {
$out .= $content;
return $content;
} elseif (is_array($content)) {
$out = '';
$keys = array_keys($content);
$count = count($keys);
for ($i = 0; $i < $count; $i++) {
@ -226,14 +226,17 @@ class XmlHelper extends AppHelper {
//$out .= $this->elem($keys[$i]
}
}
} elseif (is_object($content) && (is_a($content, 'XMLNode') || is_a($content, 'xmlnode'))) {
$out .= $content->toString();
} elseif (is_object($content) && method_exists($content, 'toString')) {
$out .= $content->toString();
} elseif (is_object($content) && method_exists($content, '__toString')) {
$out .= $content->__toString();
}
return $out;
} elseif (is_object($content) && (is_a($content, 'XMLNode') || is_a($content, 'xmlnode'))) {
return $content->toString();
} elseif (is_object($content) && method_exists($content, 'toString')) {
return $content->toString();
} elseif (is_object($content) && method_exists($content, 'toString')) {
return $content->toString();
} else {
return $content;
}
return false;
}
/**
* Serializes a model resultset into XML