BaseTemplate

Type
Abstract Class
Namespace
Craft
Inherits
Craft\BaseTemplate » Twig_Template
Since
2.0

Base Twig template class.

See also http://craftcms.com

View source (opens new window)

# Protected Methods

Method Description
displayWithErrorHandling() Displays the template.
getAttribute() Returns the attribute value for a given array/object.

# displayWithErrorHandling()

Displays the template.

View source (opens new window)

Arguments

  • $context
  • $blocks

Signature

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

# getAttribute()

Returns the attribute value for a given array/object.

View source (opens new window)

Arguments

  • $object (mixed) – The object or array from where to get the item
  • $item (mixed) – The item to get from the array or object
  • $arguments (array (opens new window)) – An array of arguments to pass if the item is an object method
  • $type (string (opens new window)) – The type of attribute (@see \Twig_Template constants)
  • $isDefinedTest (boolean (opens new window)) – Whether this is only a defined check
  • $ignoreStrictCheck (boolean (opens new window)) – Whether to ignore the strict attribute check or not

Returns

mixed – The attribute value, or a bool when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true

Throws

  • \Twig_Error_Runtime
    If the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false

Signature

protected mixed getAttribute ( $object, $item, array $arguments = [], $type = \Twig_Template::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false )