Class craft\helpers\Template
- Inheritance
- craft\helpers\Template
- Available since version
- 3.0
- Source Code
- https://github.com/craftcms/cms/blob/master/src/helpers/Template.php
Class Template
Method | Description | Defined By |
---|---|---|
attribute() |
Returns the attribute value for a given array/object. | craft\helpers\Template |
paginateCriteria() |
Paginates an element query's results | craft\helpers\Template |
raw() |
Returns a string wrapped in a \Twig_Markup object | craft\helpers\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 = [], \craft\helpers\string $type = \Twig_Template::ANY_CALL, \craft\helpers\bool $isDefinedTest = false, \craft\helpers\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 |
paginateCriteria()
public static method
#
Paginates an element query's results
public static array paginateCriteria ( craft\elements\db\ElementQueryInterface $query )
$query |
craft\elements\db\ElementQueryInterface |
raw()
public static method
#
Returns a string wrapped in a \Twig_Markup object
public static Twig_Markup raw ( \craft\helpers\string $value )
$value |
string |