mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-09 08:26:44 +02:00
cs Decorator
This commit is contained in:
@@ -2,13 +2,20 @@
|
||||
|
||||
namespace DesignPatterns\Decorator;
|
||||
|
||||
/**
|
||||
* Class RenderInJson
|
||||
*/
|
||||
class RenderInJson extends Decorator
|
||||
{
|
||||
|
||||
/**
|
||||
* render data as JSON
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function renderData()
|
||||
{
|
||||
$output = $this->_wrapped->renderData();
|
||||
$output = $this->wrapped->renderData();
|
||||
|
||||
return json_encode($output);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user