You are here

public function LayoutParagraphsBehavior::view in Layout Paragraphs 2.0.x

File

src/Plugin/paragraphs/Behavior/LayoutParagraphsBehavior.php, line 269

Class

LayoutParagraphsBehavior
Provides a way to define grid based layouts.

Namespace

Drupal\layout_paragraphs\Plugin\paragraphs\Behavior

Code

public function view(array &$build, Paragraph $paragraph, EntityViewDisplayInterface $display, $view_mode) {
  if (empty($build['regions']) && LayoutParagraphsSection::isLayoutComponent($paragraph)) {
    $build['regions'] = $this->layoutParagraphsRendererService
      ->renderLayoutSection($build, $paragraph, $view_mode);
  }
}