You are here

TestField2.php in Display Suite 8.4

File

tests/modules/ds_test/src/Plugin/DsField/TestField2.php
View source
<?php

namespace Drupal\ds_test\Plugin\DsField;

use Drupal\ds\Plugin\DsField\DsFieldBase;

/**
 * Test second field plugin.
 *
 * @DsField(
 *   id = "test_field_2",
 *   title = @Translation("Test field plugin 2"),
 *   entity_type = "node"
 * )
 */
class TestField2 extends DsFieldBase {

  /**
   * {@inheritdoc}
   */
  public function build() {
    return [
      '#markup' => 'Test field plugin on node ' . $this
        ->entity()
        ->id(),
    ];
  }

}

Classes

Namesort descending Description
TestField2 Test second field plugin.