Exemple #1
0
 /**
  * Register an extension
  *
  * An extension is just a lower level interface that modules and plugins implement
  *
  * @param Proem\Ext\Template $extension
  * @param string $event The event that will trigger this extensions init() method
  * @param int $priority The priority the Event Listener is attached at
  * @return Proem\Proem
  */
 protected function attachExtension(Extension $extension, $event = 'proem.init', $priority = 0)
 {
     $this->attachEventListener($event, function ($e) use($extension) {
         $extension->init($e->getServiceManager(), $e->getEnvironment());
     }, $priority);
     return $this;
 }
 /**
  * Register an extension
  *
  * An extension is just a lower level interface that modules and plugins implement
  *
  * @param Proem\Api\Ext\Template $extension
  * @param string $event The event that will trigger this extensions init() method
  * @param int $priority The priority the Event Listener is attached at
  * @return Proem\Api\Proem
  */
 protected function attachExtension(Extension $extension, $event = 'proem.init', $priority = 0)
 {
     $this->attachEventListener(['name' => $event, 'priority' => $priority, 'callback' => function ($e) use($extension) {
         $extension->init($e->getServiceManager(), $e->getEnvironment());
     }]);
     return $this;
 }