Sections
- Type
- Class
- Namespace
- craft\web\twig\variables
- Inherits
- craft\web\twig\variables\Sections
- Since
- 3.0.0
- Deprecated in
- in 3.0.0
Class Sections variable.
View source (opens new window)
# Public Methods
Method | Description |
---|---|
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 (opens new window)
Arguments
$indexBy
(string (opens new window), null (opens new window))
Returns
# getEditableSections()
Returns all editable sections.
View source (opens new window)
Arguments
$indexBy
(string (opens new window), null (opens new window))
Returns
# getSectionByHandle()
Returns a section by its handle.
View source (opens new window)
Arguments
$handle
(string (opens new window))
Returns
craft\models\Section, null (opens new window)
# getSectionById()
Returns a section by its ID.
View source (opens new window)
Arguments
$sectionId
(integer (opens new window))
Returns
craft\models\Section, null (opens new window)
# getTotalEditableSections()
Gets the total number of sections that are editable by the current user.
View source (opens new window)
Returns
# getTotalSections()
Gets the total number of sections.
View source (opens new window)
Returns
← Routes SystemSettings →