Default base class for compiled templates.
This class is an implementation detail of how template compilation currently works, which might change. It should never be used directly. Use $twig->load() instead, which returns an instance of \Twig\TemplateWrapper.
author | Fabien Potencier fabien@symfony.com |
---|---|
internal | |
package | Default |
__construct(\Twig\Environment $env)
\Twig\Environment
display(array $context,array $blocks = array())
array
array
displayBlock(string $name,array $context,array $blocks = array(),boolean $useBlocks = true)
This method is for internal use only and should never be called directly.
string
The block name to display
array
The context
array
The current set of blocks
boolean
Whether to use the current set of blocks
displayParentBlock(string $name,array $context,array $blocks = array())
This method is for internal use only and should never be called directly.
string
The block name to display from the parent
array
The context
array
The current set of blocks
displayWithErrorHandling(array $context,array $blocks = array())
array
array
doDisplay(array $context,array $blocks = array())
array
An array of parameters to pass to the template
array
An array of blocks to pass to the template
doGetParent(array $context)
array
getBlockNames(array $context = null,array $blocks = array()): array
This method checks blocks defined in the current template or defined in "used" traits or defined in parent templates.
array
The context
array
The current set of blocks
array
An array of block names
getBlocks(): array
This method is for internal use only and should never be called directly.
array
An array of blocks
getDebugInfo(): array
array
Debug information
getEnvironment()
deprecated | since 1.20 (to be removed in 2.0) |
---|---|
getSource(): string
deprecated | since 1.27 (to be removed in 2.0). Use getSourceContext() instead |
---|---|
string
The template source code
getSourceContext(): \Twig\Source
getTemplateName(): string
string
The template name
hasBlock(string $name,array $context = null,array $blocks = array()): boolean
This method checks blocks defined in the current template or defined in "used" traits or defined in parent templates.
string
The block name
array
The context
array
The current set of blocks
boolean
true if the block exists, false otherwise
isTraitable()
loadTemplate( $template, $templateName = null, $line = null, $index = null): \Twig\Template|\Twig\TemplateWrapper
render(array $context)
array
renderBlock(string $name,array $context,array $blocks = array(),boolean $useBlocks = true): string
This method is for internal use only and should never be called directly.
string
The block name to render
array
The context
array
The current set of blocks
boolean
Whether to use the current set of blocks
string
The rendered block
renderParentBlock(string $name,array $context,array $blocks = array()): string
This method is for internal use only and should never be called directly.
string
The block name to render from the parent
array
The context
array
The current set of blocks
string
The rendered block
parent :
parents :
env :
blocks :
traits :
sandbox :