$layouts->toBlocks()
Converts layouts to blocks
$layouts->toBlocks(bool $includeHidden = false): Kirby\Cms\Blocks
Parameters
Name | Type | Default | Description |
---|---|---|---|
$includeHidden | bool |
false
|
Sets whether to include hidden blocks |
Return type
This method modifies the existing $layouts
object it is applied to and returns it again.
Parent class
Examples
The method makes it easy to filter blocks from layouts:
$layouts = $page->layout()->toLayouts();
$blocks = $layouts->toBlocks();
$banner = $blocks->filter('type', 'banner')->first();