mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
bfc5168358
commit
f77e642f24
1 changed files with 10 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue