setRouter example

$eventArgs = new Enlight_Controller_EventArgs([
            'subject' => $this,
        ]);

        $this->eventManager->notify(
            'Enlight_Controller_Front_StartDispatch',
            $eventArgs
        );

        if (!$this->router) {
            $this->setRouter(Router::class);
        }
        if (!$this->dispatcher) {
            $this->setDispatcher('Enlight_Controller_Dispatcher_Default');
        }

        if (!$this->request) {
            $this->setRequest('Enlight_Controller_Request_RequestHttp');
        }
        if (!$this->response) {
            $this->setResponse('Enlight_Controller_Response_ResponseHttp');
        }

        
public function factory(
        Container $container,
        Enlight_Event_EventManager $eventManager,
        array $options,
        RequestStack $requestStack
    ) {
        /** @var Enlight_Controller_Front $front */
        $front = Enlight_Class::Instance('Enlight_Controller_Front', [$eventManager]);

        $front->setDispatcher($container->get('dispatcher'));

        $front->setRouter($container->get(RouterInterface::class));

        $front->setParams($options);

        $front->setRequestStack($requestStack);

        /** @var Enlight_Plugin_PluginManager $plugins */
        $plugins = $container->get('plugins');

        $plugins->registerNamespace($front->Plugins());

        if (!empty($options['throwExceptions'])) {
            
Home | Imprint | This part of the site doesn't use cookies.