Globals

Type
Class
Namespace
craft\web\twig\variables
Inherits
craft\web\twig\variables\Globals
Since
3.0
Deprecated in
in 3.0

Globals functions.

View source

Public Methods

MethodDescription
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

Arguments

Returns

array

Signature

public array getAllSets ( \craft\web\twig\variables\string $indexBy = null )

getEditableSets()

Returns all global sets that are editable by the current user.

View source

Arguments

Returns

array

Signature

public array getEditableSets ( \craft\web\twig\variables\string $indexBy = null )

getSetByHandle()

Returns a global set by its handle.

View source

Arguments

Returns

craft\elements\GlobalSet, null

Throws

Signature

public craft\elements\GlobalSet, null getSetByHandle ( \craft\web\twig\variables\string $globalSetHandle, \craft\web\twig\variables\string $siteHandle = null )

getSetById()

Returns a global set by its ID.

View source

Arguments

Returns

craft\elements\GlobalSet, null

Throws

Signature

public craft\elements\GlobalSet, null getSetById ( \craft\web\twig\variables\int $globalSetId, \craft\web\twig\variables\string $siteHandle = null )

getTotalEditableSets()

Returns the total number of global sets that are editable by the current user.

View source

Returns

integer

Signature

public integer getTotalEditableSets ( )

getTotalSets()

Returns the total number of global sets.

View source

Returns

integer

Signature

public integer getTotalSets ( )