PHP 클래스 System\Response

파일 보기 프로젝트 열기: rwarasaurus/nano 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$headers array Array of headers to be sent
$output string The final output
$status integer The response status

공개 메소드들

메소드 설명
__construct ( $output, $status = 200, $headers = [] ) Create a new instance of the Response class
create ( $output, $status = 200, $headers = [] ) : object Create a new instance of the Response class for chaining
json ( $output, $status = 200 ) : object Creates a response with the output as JSON
redirect ( $uri, $status = 302 ) : object Creates a response with a header to redirect
send ( ) Sends the final headers cookies and output

메소드 상세

__construct() 공개 메소드

Create a new instance of the Response class
public __construct ( $output, $status = 200, $headers = [] )

create() 공개 정적인 메소드

Create a new instance of the Response class for chaining
public static create ( $output, $status = 200, $headers = [] ) : object
리턴 object

json() 공개 정적인 메소드

Creates a response with the output as JSON
public static json ( $output, $status = 200 ) : object
리턴 object

redirect() 공개 정적인 메소드

Creates a response with a header to redirect
public static redirect ( $uri, $status = 302 ) : object
리턴 object

send() 공개 메소드

Sends the final headers cookies and output
public send ( )

프로퍼티 상세

$headers 공개적으로 프로퍼티

Array of headers to be sent
public array $headers
리턴 array

$output 공개적으로 프로퍼티

The final output
public string $output
리턴 string

$status 공개적으로 프로퍼티

The response status
public int $status
리턴 integer