mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-19 22:31:14 +02:00
24 lines
432 B
PHP
24 lines
432 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Creational\AbstractFactory\Json;
|
|
|
|
use DesignPatterns\Creational\AbstractFactory\Text as BaseText;
|
|
|
|
/**
|
|
* Class Text.
|
|
*
|
|
* Text is a text component with a JSON rendering
|
|
*/
|
|
class Text extends BaseText
|
|
{
|
|
/**
|
|
* some crude rendering from JSON output.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function render()
|
|
{
|
|
return json_encode(array('content' => $this->text));
|
|
}
|
|
}
|