PhpEngine
class PhpEngine extends PhpEngine implements EngineInterface
This engine knows how to render Symfony templates.
Methods
Constructor.
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.
Convert a string from one encoding to another.
Renders a view and returns a Response.
Details
at line line 37
__construct(TemplateNameParserInterface $parser, ContainerInterface $container, LoaderInterface $loader, GlobalVariables $globals = null)
Constructor.
in PhpEngine at line line 78
string
render(string|TemplateReferenceInterface $name, array $parameters = array())
Renders a template.
in PhpEngine at line line 111
bool
exists(string|TemplateReferenceInterface $name)
Returns true if the template exists.
in PhpEngine at line line 127
bool
supports(string|TemplateReferenceInterface $name)
Returns true if this class is able to render the given template.
in PhpEngine at line line 194
HelperInterface
offsetGet(string $name)
Gets a helper value.
in PhpEngine at line line 208
bool
offsetExists(string $name)
Returns true if the helper is defined.
in PhpEngine at line line 221
offsetSet(HelperInterface $name, string $value)
Sets a helper.
in PhpEngine at line line 235
offsetUnset(string $name)
Removes a helper.
in PhpEngine at line line 247
addHelpers(array $helpers)
Adds some helpers.
at line line 68
setHelpers(array $helpers)
Sets the helpers.
in PhpEngine at line line 275
set(HelperInterface $helper, string $alias = null)
Sets a helper.
in PhpEngine at line line 294
bool
has(string $name)
Returns true if the helper if defined.
at line line 51
HelperInterface
get(string $name)
Gets a helper value.
in PhpEngine at line line 326
extend(string $template)
Decorates the current template with another one.
in PhpEngine at line line 341
string
escape(mixed $value, string $context = 'html')
Escapes a string by using the current charset.
in PhpEngine at line line 367
setCharset(string $charset)
Sets the charset to use.
in PhpEngine at line line 383
string
getCharset()
Gets the current charset.
in PhpEngine at line line 396
setEscaper(string $context, mixed $escaper)
Adds an escaper for the given context.
in PhpEngine at line line 413
mixed
getEscaper(string $context)
Gets an escaper for a given context.
in PhpEngine at line line 428
addGlobal(string $name, mixed $value)
in PhpEngine at line line 440
array
getGlobals()
Returns the assigned globals.
in PhpEngine at line line 534
string
convertEncoding(string $string, string $to, string $from)
Convert a string from one encoding to another.
in PhpEngine at line line 550
LoaderInterface
getLoader()
Gets the loader associated with this engine.