PhpEngine
class PhpEngine extends PhpEngine implements EngineInterface
This engine knows how to render Symfony templates.
Properties
protected | $loader | from PhpEngine | |
protected | $current | from PhpEngine | |
protected HelperInterface[] | $helpers | from PhpEngine | |
protected | $parents | from PhpEngine | |
protected | $stack | from PhpEngine | |
protected | $charset | from PhpEngine | |
protected | $cache | from PhpEngine | |
protected | $escapers | from PhpEngine | |
static protected | $escaperCache | from PhpEngine | |
protected | $globals | from PhpEngine | |
protected | $parser | from PhpEngine | |
protected | $container |
Methods
No description
Returns true if this class is able to render the given template.
Sets the helpers.
Gets a helper value.
Escapes a string by using the current charset.
Adds an escaper for the given context.
Renders a view and returns a Response.
Details
__construct(TemplateNameParserInterface $parser, ContainerInterface $container, LoaderInterface $loader, GlobalVariables $globals = null)
string
render(string|TemplateReferenceInterface $name, array $parameters = array())
Renders a template.
bool
supports(string|TemplateReferenceInterface $name)
Returns true if this class is able to render the given template.
protected string|false
evaluate(Storage $template, array $parameters = array())
Evaluates a template.
string
escape(mixed $value, string $context = 'html')
Escapes a string by using the current charset.
protected
initializeEscapers()
Initializes the built-in escapers.
Each function specifies a way for applying a transformation to a string passed to it. The purpose is for the string to be "escaped" so it is suitable for the format it is being displayed in.
For example, the string: "It's required that you enter a username & password.\n" If this were to be displayed as HTML it would be sensible to turn the ampersand into '&' and the apostrophe into '&aps;'. However if it were going to be used as a string in JavaScript to be displayed in an alert box it would be right to leave the string as-is, but c-escape the apostrophe and the new line.
For each function there is a define to avoid problems with strings being incorrectly specified.