sfc-8.x-1.3/tests/modules/sfc_test/src/Plugin/SingleFileComponent/MultipleFormatter.php

tests/modules/sfc_test/src/Plugin/SingleFileComponent/MultipleFormatter.php
<?php

namespace Drupal\sfc_test\Plugin\SingleFileComponent;

use Drupal\sfc\ComponentBase;

/**
 * Contains an example component that acts as a field formatter.
 *
 * @SingleFileComponent(
 *   id = "multiple_formatter",
 *   field_formatter = {
 *     "label" = "Bold text",
 *     "description" = "Makes plain text bold",
 *     "field_types" = {"string"},
 *     "sfc_multiple" = true
 *   }
 * )
 *
 * @codeCoverageIgnore
 */
class MultipleFormatter extends ComponentBase {

  const TEMPLATE = <<<TWIG
<ul class="multiple-formatter">
{% for item in items %}
  <li>{{ item.getValue().value }}</li>
{% endfor %}
</ul>
TWIG;

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc