code: public function attachShared(SharedEventManagerInterface $events)
      {
          $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_BOOTSTRAP, array($this, 'onMvcBootstrapLast'), -100000);
  
          $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_RENDER, array($this, 'onRenderAddPathStacks'), -900);
          $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_RENDER, array($this, 'onRenderSpecLayout'), -1000);
      }
docs: Attach one or more listeners
  
  Implementors may add an optional $priority argument; the SharedEventManager
  implementation will pass this to the aggregate.
  
  @param SharedEventManagerInterface $events