Back to AbstractView class

Method dispatchEvent

protected void
dispatchEvent
(\Joomla\Event\EventInterface $event)
Dispatches the given event on the internal dispatcher, does a fallback to the global one.
Parameters
  • \Joomla\Event\EventInterface $event The event
Returns
  • void
Since
  • 4.1.0
Class: AbstractView
Project: Joomla

Method dispatchEvent - Source code

/**
 * Dispatches the given event on the internal dispatcher, does a fallback to the global one.
 *
 * @param   EventInterface  $event  The event
 *
 * @return  void
 *
 * @since   4.1.0
 */
protected function dispatchEvent(EventInterface $event)
{
    try {
        $this->getDispatcher()->dispatch($event->getName(), $event);
    } catch (\UnexpectedValueException $e) {
        Factory::getContainer()->get(DispatcherInterface::class)->dispatch($event->getName(), $event);
    }
}