Jobbuddy
Chargement...
Recherche...
Aucune correspondance
Référence de la classe Template

Fonctions membres publiques

 __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=[])

Champs de données

const ANY_CALL = 'any'
const ARRAY_CALL = 'array'
const METHOD_CALL = 'method'

Fonctions membres protégées

 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=[])

Attributs protégés

 $parent
 $parents = []
 $blocks = []
 $traits = []
 $traitAliases = []
 $extensions = []
 $sandbox

Description détaillée

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

Documentation des fonctions membres

◆ 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$nameThe block name to display
array$contextThe context
array$blocksThe current set of blocks
bool$useBlocksWhether 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$nameThe block name to display from the parent
array$contextThe context
array$blocksThe 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$contextAn array of parameters to pass to the template
array$blocksAn 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$contextThe context
array$blocksThe current set of blocks
Renvoie
array<string> An array of block names

◆ getBlocks()

getBlocks ( )

Returns all blocks.

This method is for internal use only and should never be called directly.

Renvoie
array An array of blocks

◆ getDebugInfo()

getDebugInfo ( )
abstract

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()

getSourceContext ( )
abstract

Returns information about the original template source code.

◆ getTemplateName()

getTemplateName ( )
abstract

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$nameThe block name
array$contextThe context
array$blocksThe 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$nameThe block name to render
array$contextThe context
array$blocksThe current set of blocks
bool$useBlocksWhether 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$nameThe block name to render from the parent
array$contextThe context
array$blocksThe 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$nameThe block name to display from the parent
array$contextThe context
array$blocksThe current set of blocks
Renvoie
iterable<scalar|\Stringable|null>

La documentation de cette classe a été générée à partir du fichier suivant :