edlp_ajax.inc 358 B

12345678910111213
  1. <?php
  2. // use Drupal\Core\Url;
  3. function template_preprocess_edlp_ajax(&$vars){
  4. // dpm($vars);
  5. /*
  6. @see https://www.drupal8.ovh/index.php/en/tutoriels/339/render-a-node-or-an-entity
  7. */
  8. $view_builder = \Drupal::entityTypeManager()->getViewBuilder($vars['entity_type']);
  9. $vars['content'] = $view_builder->view($vars['entity'], $vars['view_mode']);
  10. }