Guest User

Untitled

a guest
Dec 11th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. namespace SwagStartup1;
  5.  
  6.  
  7. use Enlight\Event\SubscriberInterface;
  8.  
  9. class FrontendSubscriber implements SubscriberInterface
  10. {
  11.  
  12. /**
  13. * Returns an array of event names this subscriber wants to listen to.
  14. *
  15. * The array keys are event names and the value can be:
  16. *
  17. * * The method name to call (position defaults to 0)
  18. * * An array composed of the method name to call and the priority
  19. * * An array of arrays composed of the method names to call and respective
  20. * priorities, or 0 if unset
  21. *
  22. * For instance:
  23. *
  24. * <code>
  25. * return array(
  26. * 'eventName0' => 'callback0',
  27. * 'eventName1' => array('callback1'),
  28. * 'eventName2' => array('callback2', 10),
  29. * 'eventName3' => array(
  30. * array('callback3_0', 5),
  31. * array('callback3_1'),
  32. * array('callback3_2')
  33. * )
  34. * );
  35. *
  36. * </code>
  37. *
  38. * @return array The event names to listen to
  39. */
  40. public static function getSubscribedEvents()
  41. {
  42. return [
  43. 'Enlight_Controller_Dispatcher_ControllerPath_Frontend_RoutingDemonstration' => 'onGetController'
  44. ];
  45. }
  46.  
  47. public function onGetController(\Enlight_Event_EventArgs $args)
  48. {
  49. return __DIR__ . '/Controllers/Frontend/RoutingDemonstration.php';
  50. }
  51. }
Add Comment
Please, Sign In to add comment