mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-06 06:57:25 +02:00
fix PSR-0
This commit is contained in:
18
Decorator/RenderInXml.php
Normal file
18
Decorator/RenderInXml.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Decorator;
|
||||
|
||||
class RenderInXml extends Decorator
|
||||
{
|
||||
public function renderData()
|
||||
{
|
||||
$output = $this->_wrapped->renderData();
|
||||
// do some fany conversion to xml from array ...
|
||||
$doc = new \DOMDocument();
|
||||
foreach ($output as $key => $val) {
|
||||
$doc->appendChild($doc->createElement('foo', 'bar'));
|
||||
}
|
||||
|
||||
return $doc->saveXML();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user