Template

Type
Abstract Class
Namespace
craft\web\twig
Inherits
craft\web\twig\Template » Twig_Template
Since
3.0

Base Twig template class.

View source

Protected Properties

Public Methods

MethodDescription
__construct()
__toString()
display()
displayBlock()Displays a block.
displayParentBlock()Displays a parent block.
getBlockNames()Returns all block names in the current context of the template.
getBlocks()Returns all blocks.
getDebugInfo()Returns debug information about the template.
getParent()Returns the parent template.
getSourceContext()Returns information about the original template source code.
getTemplateName()Returns the template name.
hasBlock()Returns whether a block exists or not in the current context of the template.
isTraitable()
render()
renderBlock()Renders a block.
renderParentBlock()Renders a parent block.

display()

View source

Arguments

  • $context
  • $blocks

Signature

public void display ( array $context, array $blocks = [] )

Protected Methods

MethodDescription
displayWithErrorHandling()Displays the template.
doDisplay()Auto-generated method to display the template with the given context.
doGetParent()
loadTemplate()

displayWithErrorHandling()

Displays the template.

View source

Arguments

Throws

Signature

protected void displayWithErrorHandling ( array $context, array $blocks = [] )

Constants

ConstantDescription
ANY_CALL
ARRAY_CALL
METHOD_CALL