getNextHighestWeight example



  /** * Appends a component to the end of a region. * * @param \Drupal\layout_builder\SectionComponent $component * The component being appended. * * @return $this */
  public function appendComponent(SectionComponent $component) {
    $component->setWeight($this->getNextHighestWeight($component->getRegion()));
    $this->setComponent($component);
    return $this;
  }

  /** * Returns the next highest weight of the component in a region. * * @param string $region * The region name. * * @return int * A number higher than the highest weight of the component in the region. */
Home | Imprint | This part of the site doesn't use cookies.