Property | Type | Description | |
---|---|---|---|
$compiled | |||
$context | |||
$stopwatch | Symfony\Component\Stopwatch\Stopwatch | null | ||
$template | Twig_Template |
Method | Description | |
---|---|---|
__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 = [] ) : |
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. |
Method | Description | |
---|---|---|
handleException ( Exception $e ) : string | The __toString method isn't allowed to throw exceptions so we turn them into an error instead |
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 |
public __toString ( ) : string | ||
return | string | The Response as HTML |
public addGlobalContext ( string $name, mixed $value ) | ||
$name | string | |
$value | mixed |
public addGlobals ( array $globals ) | ||
$globals | array |
public static create ( Twig_Template $template = null, 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 |
return |
public getContent ( ) : string | ||
return | string |
public getGlobalContext ( ) : array | ||
return | array |
public getTemplate ( ) : Twig_Template | ||
return | Twig_Template |
public getTemplateName ( ) : string | ||
return | string |
public isCompiled ( ) : boolean | ||
return | boolean |
public setContext ( array $context ) | ||
$context | array |
public setStopwatch ( Symfony\Component\Stopwatch\Stopwatch $stopwatch ) | ||
$stopwatch | Symfony\Component\Stopwatch\Stopwatch |
public setTemplate ( Twig_Template $template ) | ||
$template | Twig_Template | A template object |
protected Stopwatch,Symfony\Component\Stopwatch|null $stopwatch | ||
return | Symfony\Component\Stopwatch\Stopwatch | null |