ezcontent-8.x-dev/modules/ezcontent_paragraphs/src/Controller/EZContentParagraphsController.php

modules/ezcontent_paragraphs/src/Controller/EZContentParagraphsController.php
<?php

namespace Drupal\ezcontent_paragraphs\Controller;

use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\Response;

/**
 * Defines a route controller.
 */
class EZContentParagraphsController extends ControllerBase {

  /**
   * {@inheritdoc}
   */
  public function build($paragraph, $view_mode = 'default') {
    $content = $this->entityTypeManager()
      ->getViewBuilder('paragraph')
      ->view($paragraph, $view_mode);
    return new Response(\Drupal::service('renderer')->render($content));
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc