Overview

Namespaces

  • MvcCore
    • Ext
      • Auth
        • Virtual
      • Debug
        • Tracy
      • Form
        • Core
        • Validators
      • Request
      • Router
        • Lang
      • View
        • Helpers
  • None

Classes

  • Config
  • Controller
  • Debug
  • Model
  • Request
  • Response
  • Route
  • Router
  • Session
  • Tool
  • View
  • Overview
  • Namespace
  • Class
  • Tree

Class Response

Core response: - http response wrapper carrying response headers and response body - sending response at application terminate process by Send(); method - completing MvcCore performance custom header at response sending

Namespace: MvcCore
Located at mvccore/src/MvcCore/Response.php
Methods summary
public static MvcCore\Response
# GetInstance( integer $code = self::OK, array $headers = array(), string $body = '' )

Get everytime new instance of http response.

Get everytime new instance of http response.

Parameters

$code
$headers
$body

Returns

MvcCore\Response
public
# __construct( integer $code = self::OK, array $headers = array(), string $body = '' )

Create new http response instance.

Create new http response instance.

Parameters

$code
$headers
$body
public MvcCore\Response
# SetCode( integer $code )

Set http response code.

Set http response code.

Parameters

$code

Returns

MvcCore\Response
public MvcCore\Response
# SetHeader( string $name, string $value )

Set http response header.

Set http response header.

Parameters

$name
$value

Returns

MvcCore\Response
public MvcCore\Response
# SetBody( string $body )

Set http response body.

Set http response body.

Parameters

$body

Returns

MvcCore\Response
public MvcCore\Response
# PrependBody( string $body )

Append http response body.

Append http response body.

Parameters

$body

Returns

MvcCore\Response
public MvcCore\Response
# AppendBody( string $body )

Append http response body.

Append http response body.

Parameters

$body

Returns

MvcCore\Response
public
# UpdateHeaders( )

Consolidate headers array from php response headers array.

Consolidate headers array from php response headers array.

public boolean
# IsRedirect( )

Return if response has any Location header inside.

Return if response has any Location header inside.

Returns

boolean
public boolean
# IsHtmlOutput( )

Return if response has any html/xhtml header inside.

Return if response has any html/xhtml header inside.

Returns

boolean
public
# Send( )

Send all http headers and send response body.

Send all http headers and send response body.

protected
# addTimeAndMemoryHeader( )

Add CPU and RAM usage header at HTML/JSON response end

Add CPU and RAM usage header at HTML/JSON response end

Constants summary
integer OK
# 200
integer MOVED_PERMANENTLY
# 301
integer SEE_OTHER
# 303
integer NOT_FOUND
# 404
integer INTERNAL_SERVER_ERROR
# 500
Properties summary
public static array $CodeMessages
# array( self::OK => 'OK', self::MOVED_PERMANENTLY => 'Moved Permanently', self::SEE_OTHER => 'See Other', self::NOT_FOUND => 'Not Found', self::INTERNAL_SERVER_ERROR => 'Internal Server Error', )
public integer $Code

Response http code

Response http code

# self::OK
public array $Headers

Response http headers

Response http headers

# array()
public string $Body

Response http body

Response http body

# ''
MvcCore API documentation generated by ApiGen