og_sm-8.x-1.0/og_sm_path/src/EventSubscriber/EventSubscriber.php

og_sm_path/src/EventSubscriber/EventSubscriber.php
<?php

namespace Drupal\og_sm_path\EventSubscriber;

use Drupal\og_sm_path\Event\AjaxPathEvent;
use Drupal\og_sm_path\Event\AjaxPathEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Listens to events.
 */
class EventSubscriber implements EventSubscriberInterface {

  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    $events = [];
    $events[AjaxPathEvents::COLLECT][] = 'onAjaxPathCollection';

    return $events;
  }

  /**
   * Event listener triggered ajax path are collected.
   *
   * @param \Drupal\og_sm_path\Event\AjaxPathEvent $event
   *   The ajax path event.
   */
  public function onAjaxPathCollection(AjaxPathEvent $event) {
    $event->addPath('/entity_reference_autocomplete/.*/.*/.*');
  }

}

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

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