Move json renderer
This commit is contained in:
parent
f41db67663
commit
75a22b7b52
2 changed files with 4 additions and 2 deletions
18
src/View/Render/JsonRender.php
Normal file
18
src/View/Render/JsonRender.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Core\View\Render;
|
||||
|
||||
use Core\View\Render;
|
||||
|
||||
class JsonRender extends Render
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function render(): void
|
||||
{
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode($this->data);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue