Templating\PhpEngine (Bundle\FrameworkBundle)
Symfony\Bundle\FrameworkBundle\Templating\PhpEngine
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(string|TemplateReferenceInterface $name, array $parameters = array()) Renders a template. | from PhpEngine |
bool | exists(string|TemplateReferenceInterface $name) Returns true if the template exists. | from PhpEngine |
bool | supports(string|TemplateReferenceInterface $name) Returns true if this class is able to render the given template. | from PhpEngine |
HelperInterface | offsetGet(string $name) Gets a helper value. | from PhpEngine |
bool | 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) Adds some helpers. | from PhpEngine | |
setHelpers(array $helpers) Sets the helpers. | ||
set(HelperInterface $helper, string $alias = null) Sets a helper. | from PhpEngine | |
bool | 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
public __construct(TemplateNameParserInterface $parser, ContainerInterface $container, LoaderInterface $loader, GlobalVariables $globals = null)
Constructor.
public string render(string|TemplateReferenceInterface $name, array $parameters = array())
Renders a template.
public bool exists(string|TemplateReferenceInterface $name)
Returns true if the template exists.
public bool supports(string|TemplateReferenceInterface $name)
Returns true if this class is able to render the given template.
public HelperInterface offsetGet(string $name)
Gets a helper value.
public bool offsetExists(string $name)
Returns true if the helper is defined.
public offsetSet(HelperInterface $name, string $value)
Sets a helper.
public offsetUnset(string $name)
Removes a helper.
public addHelpers(array $helpers)
Adds some helpers.
public setHelpers(array $helpers)
Sets the helpers.
public set(HelperInterface $helper, string $alias = null)
Sets a helper.
public bool has(string $name)
Returns true if the helper if defined.
public HelperInterface get(string $name)
Gets a helper value.
public extend(string $template)
Decorates the current template with another one.
public string escape(mixed $value, string $context = 'html')
Escapes a string by using the current charset.
public setCharset(string $charset)
Sets the charset to use.
public string getCharset()
Gets the current charset.
public setEscaper(string $context, mixed $escaper)
Adds an escaper for the given context.
public mixed getEscaper(string $context)
Gets an escaper for a given context.
public addGlobal(string $name, mixed $value)
public array getGlobals()
Returns the assigned globals.
public string convertEncoding(string $string, string $to, string $from)
Convert a string from one encoding to another.
public LoaderInterface getLoader()
Gets the loader associated with this engine.
public Response renderResponse(string $view, array $parameters = array(), Response $response = null)
Renders a view and returns a Response.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Bundle/FrameworkBundle/Templating/PhpEngine.html