Class craft\web\twig\variables\Globals
- Inheritance
- craft\web\twig\variables\Globals
- Available since version
- 3.0
- Deprecated since version
- in 3.0
- Source Code
- https://github.com/craftcms/cms/blob/master/src/web/twig/variables/Globals.php
Globals functions.
Method | Description | Defined By |
---|---|---|
getAllSets() |
Returns all global sets. | craft\web\twig\variables\Globals |
getEditableSets() |
Returns all global sets that are editable by the current user. | craft\web\twig\variables\Globals |
getSetByHandle() |
Returns a global set by its handle. | craft\web\twig\variables\Globals |
getSetById() |
Returns a global set by its ID. | craft\web\twig\variables\Globals |
getTotalEditableSets() |
Returns the total number of global sets that are editable by the current user. | craft\web\twig\variables\Globals |
getTotalSets() |
Returns the total number of global sets. | craft\web\twig\variables\Globals |
Method Details
getAllSets()
public method
#
Returns all global sets.
public array getAllSets ( \craft\web\twig\variables\string $indexBy = null )
$indexBy |
string, null |
getEditableSets()
public method
#
Returns all global sets that are editable by the current user.
public array getEditableSets ( \craft\web\twig\variables\string $indexBy = null )
$indexBy |
string, null |
getSetByHandle()
public method
#
Returns a global set by its handle.
public craft\elements\GlobalSet, null getSetByHandle ( \craft\web\twig\variables\string $globalSetHandle, \craft\web\twig\variables\string $siteHandle = null )
$globalSetHandle |
string | |
$siteHandle |
string, null | |
throws | yii\base\Exception | if|null $siteHandle is invalid |
---|
getSetById()
public method
#
Returns a global set by its ID.
public craft\elements\GlobalSet, null getSetById ( \craft\web\twig\variables\int $globalSetId, \craft\web\twig\variables\string $siteHandle = null )
$globalSetId |
integer | |
$siteHandle |
string, null | |
throws | yii\base\Exception | if|null $siteHandle is invlaid |
---|
getTotalEditableSets()
public method
#
Returns the total number of global sets that are editable by the current user.
public integer getTotalEditableSets ( )
getTotalSets()
public method
#
Returns the total number of global sets.
public integer getTotalSets ( )