function Section::appendComponent

Same name in other branches
  1. 8.9.x core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::appendComponent()
  2. 10 core/modules/layout_builder/src/Section.php \Drupal\layout_builder\Section::appendComponent()
  3. 11.x 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 236

Class

Section
Provides a domain object for layout sections.

Namespace

Drupal\layout_builder

Code

public function appendComponent(SectionComponent $component) {
    $component->setWeight($this->getNextHighestWeight($component->getRegion()));
    $this->setComponent($component);
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.