quickedit_test.module 530 Bytes
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Helper module for the Quick Edit tests.
6
 */
7 8 9

use Drupal\Core\Entity\EntityInterface;

10
/**
11
 * Implements hook_quickedit_render_field().
12
 */
13
function quickedit_test_quickedit_render_field(EntityInterface $entity, $field_name, $view_mode_id, $langcode) {
14
  $entity = \Drupal::entityManager()->getTranslationFromContext($entity, $langcode);
15
  return array(
16
    '#prefix' => '<div class="quickedit-test-wrapper">',
17
    'field' => $entity->get($field_name)->view($view_mode_id),
18 19 20
    '#suffix' => '</div>',
  );
}