Class yii\twig\Template

Inheritanceyii\twig\Template

Template helper

Public Methods

Hide inherited methods

MethodDescriptionDefined By
attribute() Returns the attribute value for a given array/object. yii\twig\Template

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
displayWithErrorHandling() yii\twig\Template

Method Details

attribute() public static method

Returns the attribute value for a given array/object.

public static mixed attribute ( \Twig_Environment $env, \Twig_Source $source, $object, $item, array $arguments = [], \yii\twig\string $type = \Twig_Template::ANY_CALL, \yii\twig\bool $isDefinedTest false, \yii\twig\bool $ignoreStrictCheck false )
$env \Twig_Environment
$source \Twig_Source
$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

return mixed

The attribute value, or a Boolean 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

displayWithErrorHandling() protected method

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