ILIAS
trunk Revision v12.0_alpha-377-g3641b37b9db
◀ ilDoc Overview
class.Response.php
Go to the documentation of this file.
1
<?php
2
19
namespace
ILIAS\COPage\Editor\Server
;
20
21
class
Response
22
{
23
protected
array|\stdClass
$data
= [];
24
25
protected \ILIAS\HTTP\Services
$http
;
26
30
public
function
__construct
(array|\stdClass
$data
)
31
{
32
global
$DIC
;
33
34
$this->
http
= $DIC->http();
35
$this->data =
$data
;
36
}
37
38
public
function
send
(): void
39
{
40
$http
=
$this->http
;
41
42
$string = json_encode($this->data);
43
$stream =
\ILIAS\Filesystem\Stream\Streams::ofString
($string);
44
$http
->saveResponse(
$http
45
->response()
46
->withAddedHeader(
'Content-Type'
,
'application/json'
)
47
->withBody($stream));
48
$http
->sendResponse();
49
$http
->close();
50
}
51
}
ILIAS\COPage\Editor\Server\Response
Definition:
class.Response.php:22
ILIAS\COPage\Editor\Server\Response\send
send()
Definition:
class.Response.php:38
ILIAS\COPage\Editor\Server\Response\__construct
__construct(array|\stdClass $data)
Definition:
class.Response.php:30
ILIAS\COPage\Editor\Server\Response\$http
ILIAS HTTP Services $http
Definition:
class.Response.php:25
ILIAS\COPage\Editor\Server\Response\$data
array stdClass $data
Definition:
class.Response.php:23
ILIAS\Filesystem\Stream\Streams\ofString
static ofString(string $string)
Creates a new stream with an initial value.
Definition:
Streams.php:41
ILIAS\COPage\Editor\Server
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.Response.php:19
ILIAS\FileDelivery\http
static http()
Fetches the global http state from ILIAS.
Definition:
HttpServiceAware.php:55
$DIC
global $DIC
Definition:
shib_login.php:26
components
ILIAS
COPage
Editor
Server
class.Response.php
Generated on Sat Dec 13 2025 23:02:07 for ILIAS by
1.9.4 (using
Doxyfile
)