public function Section::appendComponent in Drupal 10
Same name and namespace in other branches
- 8 core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::appendComponent()
- 9 core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::appendComponent()
Appends a component to the end of a region.
Parameters
\Drupal\layout_builder\SectionComponent $component: The component being appended.
Return value
$this
1 call to Section::appendComponent()
- Section::insertComponent in core/
modules/ layout_builder/ src/ Section.php - Inserts a component at a specified delta.
File
- core/
modules/ layout_builder/ src/ Section.php, line 230
Class
- Section
- Provides a domain object for layout sections.
Namespace
Drupal\layout_builderCode
public function appendComponent(SectionComponent $component) {
$component
->setWeight($this
->getNextHighestWeight($component
->getRegion()));
$this
->setComponent($component);
return $this;
}