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

Protected Methods

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

displayWithErrorHandling()

Displays the template.

View source

Arguments

  • $context
  • $blocks

Signature

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

getAttribute()

Returns the attribute value for a given array/object.

View source

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) – An array of arguments to pass if the item is an object method
  • $type (string) – The type of attribute (@see \Twig_Template constants)
  • $isDefinedTest (boolean) – Whether this is only a defined check
  • $ignoreStrictCheck (boolean) – 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 )