api-8.x-1.x-dev/tests/files/sample_attributes/class.php

tests/files/sample_attributes/class.php
<?php

namespace sample1;

use Drupal\Core\Hook\Attribute\Hook;
use Drupal\Core\Render\Attribute\RenderElement;

/**
 * @RenderElement("sample_annotation")
 */
class SampleElementWithAnnotation {}

#[RenderElement('sample_attribute')]
class SampleElementWithAttribute {

  /**
   * Implements hook_sample().
   */
  #[Hook('sample', order: new OrderAfter("<script/>"))]
  function hookInClass() { }

  /**
   * Implements hook_foo_BAR_sample().
   */
  #[Hook('foo_baz_sample', order: new OrderAfter("<script/>"))]
  function dynamicHookInClass() { }

}


class OrderAfter {}

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

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