Class yii\twig\Template
Inheritance | yii\twig\Template |
---|---|
Source Code | https://github.com/yiisoft/yii2-twig/blob/master/Template.php |
Template helper
Public Methods
Method | Description | Defined By |
---|---|---|
attribute() | Returns the attribute value for a given array/object. | yii\twig\Template |
Protected Methods
Method | Description | Defined By |
---|---|---|
displayWithErrorHandling() | yii\twig\Template |
Method Details
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 |
protected void displayWithErrorHandling ( array $context, array $blocks = [] ) | ||
$context | ||
$blocks |