mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 09:42:24 +01:00
22 lines
337 B
PHP
22 lines
337 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Structural\Decorator;
|
|
|
|
/**
|
|
* Class RenderInJson.
|
|
*/
|
|
class RenderInJson extends Decorator
|
|
{
|
|
/**
|
|
* render data as JSON.
|
|
*
|
|
* @return mixed|string
|
|
*/
|
|
public function renderData()
|
|
{
|
|
$output = $this->wrapped->renderData();
|
|
|
|
return json_encode($output);
|
|
}
|
|
}
|