Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

http_response.php
Go to the documentation of this file.
1 <?php
12 class ezpRestHttpResponse implements ezcMvcResultStatusObject
13 {
14 public $code;
15 public $message;
16
17 public function __construct( $code = null, $message = null )
18 {
19 $this->code = $code;
20 $this->message = $message;
21 }
22
23 public function process( ezcMvcResponseWriter $writer )
24 {
25 if ( $writer instanceof ezcMvcHttpResponseWriter )
26 {
27 $writer->headers["HTTP/1.1 " . $this->code] = $this->message;
28 }
29
30 if ( $this->message !== null )
31 {
32 $writer->headers['Content-Type'] = 'application/json; charset=UTF-8';
33 $writer->response->body = json_encode( array( 'error_message' => $this->message ) );
34 }
35 }
36 }
37 ?>
ezpRestHttpResponse
Definition: http_response.php:13
ezpRestHttpResponse\$code
$code
Definition: http_response.php:14
ezpRestHttpResponse\__construct
__construct( $code=null, $message=null)
Definition: http_response.php:17
ezpRestHttpResponse\$message
$message
Definition: http_response.php:15
ezpRestHttpResponse\process
process(ezcMvcResponseWriter $writer)
Definition: http_response.php:23
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.