ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
class.Response.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
namespace
ILIAS\COPage\Editor\Server
;
6
11
class
Response
12
{
16
protected
$data
= [];
17
21
protected
$http
;
22
26
public
function
__construct
(
$data
)
27
{
28
global
$DIC
;
29
30
$this->
http
= $DIC->http();
31
$this->data =
$data
;
32
}
33
39
public
function
send
()
40
{
41
$http
=
$this->http
;
42
43
$string = json_encode($this->data);
44
$stream =
\ILIAS\Filesystem\Stream\Streams::ofString
($string);
45
$http
->saveResponse(
$http
46
->response()
47
->withAddedHeader(
'Content-Type'
,
'application/json'
)
48
->withBody($stream));
49
$http
->sendResponse();
50
$http
->close();
51
}
52
}
ILIAS\COPage\Editor\Server\Response
Definition:
class.Response.php:11
ILIAS\COPage\Editor\Server\Response\$http
$http
Definition:
class.Response.php:21
ILIAS\COPage\Editor\Server
Definition:
class.Response.php:5
ILIAS\FileDelivery\http
static http()
Fetches the global http state from ILIAS.
Definition:
HttpServiceAware.php:36
$DIC
global $DIC
Definition:
goto.php:24
ILIAS\Filesystem\Stream\Streams\ofString
static ofString($string)
Creates a new stream with an initial value.
Definition:
Streams.php:25
ILIAS\COPage\Editor\Server\Response\send
send()
Definition:
class.Response.php:39
ILIAS\COPage\Editor\Server\Response\__construct
__construct($data)
Constructor.
Definition:
class.Response.php:26
ILIAS\COPage\Editor\Server\Response\$data
$data
Definition:
class.Response.php:16
Services
COPage
Editor
Server
class.Response.php
Generated on Wed Sep 3 2025 21:01:25 for ILIAS by
1.8.13 (using
Doxyfile
)