class PhpEngine extends PhpEngine implements EngineInterface
This engine knows how to render Symfony templates.
Methods
|
__construct(TemplateNameParserInterface $parser, ContainerInterface $container, LoaderInterface $loader, GlobalVariables $globals = null)
Constructor. |
||
| string |
render(mixed $name, array $parameters = array())
Renders a template. |
from PhpEngine |
| Boolean |
exists(mixed $name)
Returns true if the template exists. |
from PhpEngine |
| Boolean |
supports(mixed $name)
Returns true if this class is able to render the given template. |
from PhpEngine |
| mixed |
offsetGet(string $name)
Gets a helper value. |
from PhpEngine |
| Boolean |
offsetExists(string $name)
Returns true if the helper is defined. |
from PhpEngine |
|
offsetSet(HelperInterface $name, string $value)
Sets a helper. |
from PhpEngine | |
|
offsetUnset(string $name)
Removes a helper. |
from PhpEngine | |
| addHelpers(array $helpers) | from PhpEngine | |
|
setHelpers(array $helpers)
Sets the helpers. |
||
|
set(HelperInterface $helper, string $alias = null)
Sets a helper. |
from PhpEngine | |
| Boolean |
has(string $name)
Returns true if the helper if defined. |
from PhpEngine |
| HelperInterface |
get(string $name)
Gets a helper value. |
|
|
extend(string $template)
Decorates the current template with another one. |
from PhpEngine | |
| string |
escape(mixed $value, string $context = 'html')
Escapes a string by using the current charset. |
from PhpEngine |
|
setCharset(string $charset)
Sets the charset to use. |
from PhpEngine | |
| string |
getCharset()
Gets the current charset. |
from PhpEngine |
|
setEscaper(string $context, mixed $escaper)
Adds an escaper for the given context. |
from PhpEngine | |
| mixed |
getEscaper(string $context)
Gets an escaper for a given context. |
from PhpEngine |
| addGlobal(string $name, mixed $value) | from PhpEngine | |
| array |
getGlobals()
Returns the assigned globals. |
from PhpEngine |
| string |
convertEncoding(string $string, string $to, string $from)
Convert a string from one encoding to another. |
from PhpEngine |
| LoaderInterface |
getLoader()
Gets the loader associated with this engine. |
from PhpEngine |
| Response |
renderResponse(string $view, array $parameters = array(), Response $response = null)
Renders a view and returns a Response. |
Details
at line 37
public
__construct(TemplateNameParserInterface $parser, ContainerInterface $container, LoaderInterface $loader, GlobalVariables $globals = null)
Constructor.
in PhpEngine at line 78
public string
render(mixed $name, array $parameters = array())
Renders a template.
in PhpEngine at line 115
public Boolean
exists(mixed $name)
Returns true if the template exists.
in PhpEngine at line 135
public Boolean
supports(mixed $name)
Returns true if this class is able to render the given template.
in PhpEngine at line 188
public mixed
offsetGet(string $name)
Gets a helper value.
in PhpEngine at line 202
public Boolean
offsetExists(string $name)
Returns true if the helper is defined.
in PhpEngine at line 215
public
offsetSet(HelperInterface $name, string $value)
Sets a helper.
in PhpEngine at line 227
public
offsetUnset(string $name)
Removes a helper.
in PhpEngine at line 237
public
addHelpers(array $helpers)
at line 68
public
setHelpers(array $helpers)
Sets the helpers.
in PhpEngine at line 265
public
set(HelperInterface $helper, string $alias = null)
Sets a helper.
in PhpEngine at line 284
public Boolean
has(string $name)
Returns true if the helper if defined.
at line 51
public HelperInterface
get(string $name)
Gets a helper value.
in PhpEngine at line 316
public
extend(string $template)
Decorates the current template with another one.
in PhpEngine at line 331
public string
escape(mixed $value, string $context = 'html')
Escapes a string by using the current charset.
in PhpEngine at line 343
public
setCharset(string $charset)
Sets the charset to use.
in PhpEngine at line 355
public string
getCharset()
Gets the current charset.
in PhpEngine at line 368
public
setEscaper(string $context, mixed $escaper)
Adds an escaper for the given context.
in PhpEngine at line 382
public mixed
getEscaper(string $context)
Gets an escaper for a given context.
in PhpEngine at line 397
public
addGlobal(string $name, mixed $value)
in PhpEngine at line 409
public array
getGlobals()
Returns the assigned globals.
in PhpEngine at line 501
public string
convertEncoding(string $string, string $to, string $from)
Convert a string from one encoding to another.
in PhpEngine at line 517
public LoaderInterface
getLoader()
Gets the loader associated with this engine.
at line 82
public Response
renderResponse(string $view, array $parameters = array(), Response $response = null)
Renders a view and returns a Response.