MAPG-86 refactor view-controller
This commit is contained in:
1 parent
b0b244712f
commit
88fe7b7a03
7 files changed
+62
-17
No files matched your search
@@ -0,0 +1,21 @@
|
||||
<?php namespace MapGuesser\Response;
|
||||
|
||||
class JsonContent extends ContentBase
|
||||
{
|
||||
public function __construct(array &$data = [])
|
||||
{
|
||||
$this->data = &$data;
|
||||
}
|
||||
|
||||
public function &render(): string
|
||||
{
|
||||
$content = json_encode($this->data);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function getContentType(): string
|
||||
{
|
||||
return 'application/json';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user