|
|
| __construct (protected Environment $env,) |
| | getTemplateName () |
| | getDebugInfo () |
| | getSourceContext () |
| | getParent (array $context) |
|
| isTraitable () |
| | displayParentBlock ($name, array $context, array $blocks=[]) |
| | displayBlock ($name, array $context, array $blocks=[], $useBlocks=true, ?self $templateContext=null) |
| | renderParentBlock ($name, array $context, array $blocks=[]) |
| | renderBlock ($name, array $context, array $blocks=[], $useBlocks=true) |
| | hasBlock ($name, array $context, array $blocks=[]) |
| | getBlockNames (array $context, array $blocks=[]) |
|
| unwrap () |
| | getBlocks () |
|
| display (array $context, array $blocks=[]) |
|
| render (array $context) |
| | yield (array $context, array $blocks=[]) |
| | yieldBlock ($name, array $context, array $blocks=[], $useBlocks=true, ?self $templateContext=null) |
| | yieldParentBlock ($name, array $context, array $blocks=[]) |
|
|
const | ANY_CALL = 'any' |
|
const | ARRAY_CALL = 'array' |
|
const | METHOD_CALL = 'method' |
|
|
| doGetParent (array $context) |
| | load (string|TemplateWrapper|array $template, int $line, ?int $index=null) |
| | loadTemplate ($template, $templateName=null, ?int $line=null, ?int $index=null) |
|
| hasMacro (string $name, array $context) |
|
| getTemplateForMacro (string $name, array $context, int $line, Source $source) |
| | doDisplay (array $context, array $blocks=[]) |
|
|
| $parent |
|
| $parents = [] |
|
| $blocks = [] |
|
| $traits = [] |
|
| $traitAliases = [] |
|
| $extensions = [] |
|
| $sandbox |
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.
- Auteur
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
◆ displayBlock()
| displayBlock |
( |
| $name, |
|
|
array | $context, |
|
|
array | $blocks = [], |
|
|
| $useBlocks = true, |
|
|
?self | $templateContext = null ) |
Displays a block.
This method is for internal use only and should never be called directly.
- Paramètres
-
| string | $name | The block name to display |
| array | $context | The context |
| array | $blocks | The current set of blocks |
| bool | $useBlocks | Whether to use the current set of blocks |
◆ displayParentBlock()
| displayParentBlock |
( |
| $name, |
|
|
array | $context, |
|
|
array | $blocks = [] ) |
Displays a parent block.
This method is for internal use only and should never be called directly.
- Paramètres
-
| string | $name | The block name to display from the parent |
| array | $context | The context |
| array | $blocks | The current set of blocks |
◆ doDisplay()
| doDisplay |
( |
array | $context, |
|
|
array | $blocks = [] ) |
|
abstractprotected |
Auto-generated method to display the template with the given context.
- Paramètres
-
| array | $context | An array of parameters to pass to the template |
| array | $blocks | An array of blocks to pass to the template |
- Renvoie
- iterable<scalar|\Stringable|null>
◆ getBlockNames()
| getBlockNames |
( |
array | $context, |
|
|
array | $blocks = [] ) |
Returns all block names in the current context of the template.
This method checks blocks defined in the current template or defined in "used" traits or defined in parent templates.
- Paramètres
-
| array | $context | The context |
| array | $blocks | The current set of blocks |
- Renvoie
- array<string> An array of block names
◆ getBlocks()
Returns all blocks.
This method is for internal use only and should never be called directly.
- Renvoie
- array An array of blocks
◆ getDebugInfo()
Returns debug information about the template.
- Renvoie
- array<int, int> Debug information
◆ getParent()
| getParent |
( |
array | $context | ) |
|
Returns the parent template.
This method is for internal use only and should never be called directly.
- Renvoie
- self|TemplateWrapper|false The parent template or false if there is no parent
◆ getSourceContext()
Returns information about the original template source code.
◆ getTemplateName()
Returns the template name.
◆ hasBlock()
| hasBlock |
( |
| $name, |
|
|
array | $context, |
|
|
array | $blocks = [] ) |
Returns whether a block exists or not in the current context of the template.
This method checks blocks defined in the current template or defined in "used" traits or defined in parent templates.
- Paramètres
-
| string | $name | The block name |
| array | $context | The context |
| array | $blocks | The current set of blocks |
- Renvoie
- bool true if the block exists, false otherwise
◆ load()
| load |
( |
string|TemplateWrapper|array | $template, |
|
|
int | $line, |
|
|
?int | $index = null ) |
|
protected |
- Paramètres
-
| string|TemplateWrapper|array<string|TemplateWrapper> | $template |
◆ loadTemplate()
| loadTemplate |
( |
| $template, |
|
|
| $templateName = null, |
|
|
?int | $line = null, |
|
|
?int | $index = null ) |
|
protected |
- Paramètres
-
| string|TemplateWrapper|array<string|TemplateWrapper> | $template |
- Obsolète
- since Twig 3.21 and will be removed in 4.0. Use Template::load() instead.
◆ renderBlock()
| renderBlock |
( |
| $name, |
|
|
array | $context, |
|
|
array | $blocks = [], |
|
|
| $useBlocks = true ) |
Renders a block.
This method is for internal use only and should never be called directly.
- Paramètres
-
| string | $name | The block name to render |
| array | $context | The context |
| array | $blocks | The current set of blocks |
| bool | $useBlocks | Whether to use the current set of blocks |
- Renvoie
- string The rendered block
◆ renderParentBlock()
| renderParentBlock |
( |
| $name, |
|
|
array | $context, |
|
|
array | $blocks = [] ) |
Renders a parent block.
This method is for internal use only and should never be called directly.
- Paramètres
-
| string | $name | The block name to render from the parent |
| array | $context | The context |
| array | $blocks | The current set of blocks |
- Renvoie
- string The rendered block
◆ yield()
| yield |
( |
array | $context, |
|
|
array | $blocks = [] ) |
- Renvoie
- iterable<scalar|\Stringable|null>
◆ yieldBlock()
| yieldBlock |
( |
| $name, |
|
|
array | $context, |
|
|
array | $blocks = [], |
|
|
| $useBlocks = true, |
|
|
?self | $templateContext = null ) |
- Renvoie
- iterable<scalar|\Stringable|null>
◆ yieldParentBlock()
| yieldParentBlock |
( |
| $name, |
|
|
array | $context, |
|
|
array | $blocks = [] ) |
Yields a parent block.
This method is for internal use only and should never be called directly.
- Paramètres
-
| string | $name | The block name to display from the parent |
| array | $context | The context |
| array | $blocks | The current set of blocks |
- Renvoie
- iterable<scalar|\Stringable|null>
La documentation de cette classe a été générée à partir du fichier suivant :
- vendor/twig/twig/src/Template.php