PhpEngine
class PhpEngine implements EngineInterface, ArrayAccess
PhpEngine is an engine able to render PHP templates.
Methods
Constructor.
Returns true if this class is able to render the given template.
Gets a helper value.
Returns true if the helper is defined.
Removes a helper.
Adds some helpers.
Sets the helpers.
Returns true if the helper if defined.
Gets a helper value.
Decorates the current template with another one.
Escapes a string by using the current charset.
Sets the charset to use.
Gets the current charset.
Adds an escaper for the given context.
Gets an escaper for a given context.
No description
Returns the assigned globals.
Gets the loader associated with this engine.
Details
at line line 52
__construct(TemplateNameParserInterface $parser, LoaderInterface $loader, array $helpers = array())
Constructor.
at line line 70
string
render(string|TemplateReferenceInterface $name, array $parameters = array())
Renders a template.
at line line 101
bool
exists(string|TemplateReferenceInterface $name)
Returns true if the template exists.
at line line 115
bool
supports(string|TemplateReferenceInterface $name)
Returns true if this class is able to render the given template.
at line line 180
HelperInterface
offsetGet(string $name)
Gets a helper value.
at line line 192
bool
offsetExists(string $name)
Returns true if the helper is defined.
at line line 203
offsetSet(HelperInterface $name, string $value)
Sets a helper.
at line line 215
offsetUnset(string $name)
Removes a helper.
at line line 225
addHelpers(array $helpers)
Adds some helpers.
at line line 237
setHelpers(array $helpers)
Sets the helpers.
at line line 249
set(HelperInterface $helper, string $alias = null)
Sets a helper.
at line line 266
bool
has(string $name)
Returns true if the helper if defined.
at line line 280
HelperInterface
get(string $name)
Gets a helper value.
at line line 294
extend(string $template)
Decorates the current template with another one.
at line line 307
string
escape(mixed $value, string $context = 'html')
Escapes a string by using the current charset.
at line line 331
setCharset(string $charset)
Sets the charset to use.
at line line 348
string
getCharset()
Gets the current charset.
at line line 359
setEscaper(string $context, callable $escaper)
Adds an escaper for the given context.
at line line 374
callable
getEscaper(string $context)
Gets an escaper for a given context.
at line line 387
addGlobal(string $name, mixed $value)
at line line 397
array
getGlobals()
Returns the assigned globals.
at line line 486
LoaderInterface
getLoader()
Gets the loader associated with this engine.