Property | Type | Description | |
---|---|---|---|
$cache | |||
$charset | |||
$current | |||
$escaperCache | |||
$escapers | |||
$globals | |||
$helpers | |||
$loader | |||
$parents | |||
$parser | |||
$stack |
Method | Description | |
---|---|---|
__construct ( Symfony\Component\Templating\TemplateNameParserInterface $parser, Symfony\Component\Templating\Loader\LoaderInterface $loader, array $helpers = [] ) | Constructor. | |
addGlobal ( string $name, mixed $value ) | ||
addHelpers ( array $helpers ) | ||
convertEncoding ( string $string, string $to, string $from ) : string | Convert a string from one encoding to another. | |
escape ( mixed $value, string $context = 'html' ) : string | Escapes a string by using the current charset. | |
exists ( mixed $name ) : boolean | Returns true if the template exists. | |
extend ( string $template ) | Decorates the current template with another one. | |
get ( string $name ) : Symfony\Component\Templating\Helper\HelperInterface | Gets a helper value. | |
getCharset ( ) : string | Gets the current charset. | |
getEscaper ( string $context ) : mixed | Gets an escaper for a given context. | |
getGlobals ( ) : array | Returns the assigned globals. | |
getLoader ( ) : Symfony\Component\Templating\Loader\LoaderInterface | Gets the loader associated with this engine. | |
has ( string $name ) : boolean | Returns true if the helper if defined. | |
offsetExists ( string $name ) : boolean | Returns true if the helper is defined. | |
offsetGet ( string $name ) : mixed | Gets a helper value. | |
offsetSet ( Symfony\Component\Templating\Helper\HelperInterface $name, string $value ) | Sets a helper. | |
offsetUnset ( string $name ) | Removes a helper. | |
render ( mixed $name, array $parameters = [] ) : string | Renders a template. | |
set ( Symfony\Component\Templating\Helper\HelperInterface $helper, string $alias = null ) | Sets a helper. | |
setCharset ( string $charset ) | Sets the charset to use. | |
setEscaper ( string $context, mixed $escaper ) | Adds an escaper for the given context. | |
setHelpers ( array $helpers ) | Sets the helpers. | |
supports ( mixed $name ) : boolean | Returns true if this class is able to render the given template. |
Method | Description | |
---|---|---|
evaluate ( Symfony\Component\Templating\Storage\Storage $template, array $parameters = [] ) : string | false | Evaluates a template. | |
initializeEscapers ( ) | Initializes the built-in escapers. | |
load ( mixed $name ) : Symfony\Component\Templating\Storage\Storage | Loads the given template. |
public __construct ( Symfony\Component\Templating\TemplateNameParserInterface $parser, Symfony\Component\Templating\Loader\LoaderInterface $loader, array $helpers = [] ) | ||
$parser | Symfony\Component\Templating\TemplateNameParserInterface | A TemplateNameParserInterface instance |
$loader | Symfony\Component\Templating\Loader\LoaderInterface | A loader instance |
$helpers | array | An array of helper instances |
protected evaluate ( Symfony\Component\Templating\Storage\Storage $template, array $parameters = [] ) : string | false | ||
$template | Symfony\Component\Templating\Storage\Storage | The template to render |
$parameters | array | An array of parameters to pass to the template |
return | string | false | The evaluated template, or false if the engine is unable to render the template |
public getCharset ( ) : string | ||
return | string | The current charset |
public getEscaper ( string $context ) : mixed | ||
$context | string | The context name |
return | mixed | $escaper A PHP callable |
public getLoader ( ) : Symfony\Component\Templating\Loader\LoaderInterface | ||
return | Symfony\Component\Templating\Loader\LoaderInterface | A LoaderInterface instance |
protected initializeEscapers ( ) |
public offsetExists ( string $name ) : boolean | ||
$name | string | The helper name |
return | boolean | true if the helper is defined, false otherwise |
public offsetUnset ( string $name ) | ||
$name | string | The helper name |
public setCharset ( string $charset ) | ||
$charset | string | The charset |
public setEscaper ( string $context, mixed $escaper ) | ||
$context | string | The escaper context (html, js, ...) |
$escaper | mixed | A PHP callable |