Globals
- Type
- Class
- Namespace
- craft\web\twig\variables
- Inherits
- craft\web\twig\variables\Globals
- Since
- 3.0.0
- Deprecated in
- in 3.0.0
Globals functions.
View source (opens new window)
# Public Methods
Method | Description |
---|---|
getAllSets() | Returns all global sets. |
getEditableSets() | Returns all global sets that are editable by the current user. |
getSetByHandle() | Returns a global set by its handle. |
getSetById() | Returns a global set by its ID. |
getTotalEditableSets() | Returns the total number of global sets that are editable by the current user. |
getTotalSets() | Returns the total number of global sets. |
# getAllSets()
Returns all global sets.
View source (opens new window)
Arguments
$indexBy
(string (opens new window), null (opens new window))
Returns
# getEditableSets()
Returns all global sets that are editable by the current user.
View source (opens new window)
Arguments
$indexBy
(string (opens new window), null (opens new window))
Returns
# getSetByHandle()
Returns a global set by its handle.
View source (opens new window)
Arguments
$globalSetHandle
(string (opens new window))$siteHandle
(string (opens new window), null (opens new window))
Returns
craft\elements\GlobalSet, null (opens new window)
Throws
- yii\base\Exception (opens new window)
if|null $siteHandle is invalid
# getSetById()
Returns a global set by its ID.
View source (opens new window)
Arguments
$globalSetId
(integer (opens new window))$siteHandle
(string (opens new window), null (opens new window))
Returns
craft\elements\GlobalSet, null (opens new window)
Throws
- yii\base\Exception (opens new window)
if|null $siteHandle is invlaid
# getTotalEditableSets()
Returns the total number of global sets that are editable by the current user.
View source (opens new window)
Returns
# getTotalSets()
Returns the total number of global sets.
View source (opens new window)