EntityEmbedTestTwigController::idRender()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\entity_embed_test;
4
5
/**
6
 * Controller routines for Twig theme test routes.
7
 */
8
class EntityEmbedTestTwigController {
9
10
  /**
11
   * Menu callback for testing entity_embed twig extension using entity ID.
12
   */
13
  public function idRender() {
14
    return array(
15
      '#theme' => 'entity_embed_twig_test',
16
      '#entity_type' => 'node',
17
      '#id' => '1',
18
    );
19
  }
20
21
  /**
22
   * Menu callback for testing entity_embed twig extension using 'label' Entity Embed Display plugin.
23
   */
24
  public function labelPluginRender() {
25
    return array(
26
      '#theme' => 'entity_embed_twig_test',
27
      '#entity_type' => 'node',
28
      '#id' => '1',
29
      '#display_plugin' => 'entity_reference:entity_reference_label',
30
    );
31
  }
32
33
  /**
34
   * Menu callback for testing entity_embed twig extension using 'label' Entity Embed Display plugin without linking to the node.
35
   */
36
  public function labelPluginNoLinkRender() {
37
    return array(
38
      '#theme' => 'entity_embed_twig_test',
39
      '#entity_type' => 'node',
40
      '#id' => '1',
41
      '#display_plugin' => 'entity_reference:entity_reference_label',
42
      '#display_settings' => array('link' => 0),
43
    );
44
  }
45
46
}
47