mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 01:32:22 +01:00
22 lines
335 B
PHP
22 lines
335 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);
|
|
}
|
|
}
|