PHP 클래스 Bolt\Response\BoltResponse

사용 중단: Deprecated since 3.3, use TemplateResponse instead.
저자: Ross Riley ([email protected])
상속: extends Symfony\Component\HttpFoundation\Response
파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$compiled
$context
$stopwatch Symfony\Component\Stopwatch\Stopwatch | null
$template Twig_Template

공개 메소드들

메소드 설명
__construct ( Twig_Template $template, array $context = [], array $globals = [], integer $status = 200, array $headers = [] ) Constructor.
__toString ( ) : string Returns the Response as a string.
addGlobalContext ( string $name, mixed $value ) Adds a global to the template
addGlobals ( array $globals ) Adds globals to the template
compile ( ) Compiles the template using the context.
create ( Twig_Template $template = null, array $context = [], array $globals = [], integer $status = 200, array $headers = [] ) : BoltResponse Factory method for chainability
getContent ( ) : string Gets HTML content for the response.
getContext ( ) : array Returns the context.
getGlobalContext ( ) : array Gets globals from the template.
getTemplate ( ) : Twig_Template Returns the template.
getTemplateName ( ) : string Gets the name of the main loaded template.
isCompiled ( ) : boolean Returns whether the response has been compiled
setContext ( array $context ) Sets the context variables for this Response.
setStopwatch ( Symfony\Component\Stopwatch\Stopwatch $stopwatch )
setTemplate ( Twig_Template $template ) Sets the Renderer used to create this Response.

비공개 메소드들

메소드 설명
handleException ( Exception $e ) : string The __toString method isn't allowed to throw exceptions so we turn them into an error instead

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Twig_Template $template, array $context = [], array $globals = [], integer $status = 200, array $headers = [] )
$template Twig_Template An object that is able to render a template with context
$context array An array of context variables
$globals array An array of global context variables
$status integer The response status code
$headers array An array of response headers

__toString() 공개 메소드

Returns the Response as a string.
public __toString ( ) : string
리턴 string The Response as HTML

addGlobalContext() 공개 메소드

Adds a global to the template
public addGlobalContext ( string $name, mixed $value )
$name string
$value mixed

addGlobals() 공개 메소드

Adds globals to the template
public addGlobals ( array $globals )
$globals array

compile() 공개 메소드

Compiles the template using the context.
public compile ( )

create() 공개 정적인 메소드

Factory method for chainability
public static create ( Twig_Template $template = null, array $context = [], array $globals = [], integer $status = 200, array $headers = [] ) : BoltResponse
$template Twig_Template An object that is able to render a template with context
$context array An array of context variables
$globals array An array of global context variables
$status integer The response status code
$headers array An array of response headers
리턴 BoltResponse

getContent() 공개 메소드

Gets HTML content for the response.
public getContent ( ) : string
리턴 string

getContext() 공개 메소드

Returns the context.
public getContext ( ) : array
리턴 array

getGlobalContext() 공개 메소드

Gets globals from the template.
public getGlobalContext ( ) : array
리턴 array

getTemplate() 공개 메소드

Returns the template.
public getTemplate ( ) : Twig_Template
리턴 Twig_Template

getTemplateName() 공개 메소드

Gets the name of the main loaded template.
public getTemplateName ( ) : string
리턴 string

isCompiled() 공개 메소드

Returns whether the response has been compiled
public isCompiled ( ) : boolean
리턴 boolean

setContext() 공개 메소드

Sets the context variables for this Response.
public setContext ( array $context )
$context array

setStopwatch() 공개 메소드

public setStopwatch ( Symfony\Component\Stopwatch\Stopwatch $stopwatch )
$stopwatch Symfony\Component\Stopwatch\Stopwatch

setTemplate() 공개 메소드

Sets the Renderer used to create this Response.
public setTemplate ( Twig_Template $template )
$template Twig_Template A template object

프로퍼티 상세

$compiled 보호되어 있는 프로퍼티

protected $compiled

$context 보호되어 있는 프로퍼티

protected $context

$stopwatch 보호되어 있는 프로퍼티

protected Stopwatch,Symfony\Component\Stopwatch|null $stopwatch
리턴 Symfony\Component\Stopwatch\Stopwatch | null

$template 보호되어 있는 프로퍼티

protected Twig_Template $template
리턴 Twig_Template