Craft 3 Class Reference

Class craft\web\twig\variables\Sections

Inheritance
craft\web\twig\variables\Sections
Available since version
3.0
Deprecated since version
in 3.0
Source Code
https://github.com/craftcms/cms/blob/master/src/web/twig/variables/Sections.php

Class Sections variable.

Public Methods
Method Description Defined By
getAllSections() Returns all sections. craft\web\twig\variables\Sections
getEditableSections() Returns all editable sections. craft\web\twig\variables\Sections
getSectionByHandle() Returns a section by its handle. craft\web\twig\variables\Sections
getSectionById() Returns a section by its ID. craft\web\twig\variables\Sections
getTotalEditableSections() Gets the total number of sections that are editable by the current user. craft\web\twig\variables\Sections
getTotalSections() Gets the total number of sections. craft\web\twig\variables\Sections

Method Details

getAllSections() public method #

Returns all sections.

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

getEditableSections() public method #

Returns all editable sections.

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

getSectionByHandle() public method #

Returns a section by its handle.

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

getSectionById() public method #

Returns a section by its ID.

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

getTotalEditableSections() public method #

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

public integer getTotalEditableSections ( )

getTotalSections() public method #

Gets the total number of sections.

public integer getTotalSections ( )