Sections

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

Class Sections variable.

View source

Public Methods

MethodDescription
getAllSections()Returns all sections.
getEditableSections()Returns all editable sections.
getSectionByHandle()Returns a section by its handle.
getSectionById()Returns a section by its ID.
getTotalEditableSections()Gets the total number of sections that are editable by the current user.
getTotalSections()Gets the total number of sections.

getAllSections()

Returns all sections.

View source

Arguments

Returns

array

Signature

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

getEditableSections()

Returns all editable sections.

View source

Arguments

Returns

array

Signature

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

getSectionByHandle()

Returns a section by its handle.

View source

Arguments

Returns

craft\models\Section, null

Signature

public craft\models\Section, null getSectionByHandle ( \craft\web\twig\variables\string $handle )

getSectionById()

Returns a section by its ID.

View source

Arguments

Returns

craft\models\Section, null

Signature

public craft\models\Section, null getSectionById ( \craft\web\twig\variables\int $sectionId )

getTotalEditableSections()

Gets the total number of sections that are editable by the current user.

View source

Returns

integer

Signature

public integer getTotalEditableSections ( )

getTotalSections()

Gets the total number of sections.

View source

Returns

integer

Signature

public integer getTotalSections ( )