getEntityDisplay example

$this->pluginManager = $plugin_manager;
    $this->entityDisplayRepository = $entity_display_repository;
    $this->entityFieldManager = $entity_field_manager;
  }

  /** * {@inheritdoc} */
  public function getEntityFromRouteMatch(RouteMatchInterface $route_match$entity_type_id) {
    $route_parameters = $route_match->getParameters()->all();

    return $this->getEntityDisplay($route_parameters['entity_type_id']$route_parameters['bundle']$route_parameters[$this->displayContext . '_mode_name']);
  }

  /** * Get the regions needed to create the overview form. * * @return array * Example usage: * @code * return array( * 'content' => array( * // label for the region. * 'title' => $this->t('Content'), * // Indicates if the region is visible in the UI. * 'invisible' => TRUE, * // A message to indicate that there is nothing to be displayed in * // the region. * 'message' => $this->t('No field is displayed.'), * ), * ); * @endcode */
Home | Imprint | This part of the site doesn't use cookies.