setFront example


    public function setRouter($router)
    {
        if (\is_string($router)) {
            $router = new $router();
        }
        if (!$router instanceof Enlight_Controller_Router) {
            throw new Enlight_Exception('Invalid router class');
        }
        $router->setFront($this);
        $this->router = $router;

        return $this;
    }

    /** * Setter method for the dispatcher. Sets the front controller instance * automatically in the given dispatcher. * * @param class-string<Enlight_Controller_Dispatcher>|Enlight_Controller_Dispatcher $dispatcher * * @throws Enlight_Exception * * @return Enlight_Controller_Front */
/** @var Enlight_Controller_Action $controller */
            $controller = $class;
        }

        if ($controller instanceof ContainerAwareInterface) {
            $container = Shopware()->Container();
            $controller->setContainer($container);
        }

        $controller->initController($request$response);

        $controller->setFront($this->Front());

        $action = $this->getActionMethod($request);

        $request->setDispatched(true);

        $disableOb = $this->Front()->getParam('disableOutputBuffering');
        $obLevel = ob_get_level();
        if (empty($disableOb)) {
            ob_start();
        }

        
/** * Returns front controller * * @throws Exception * * @return Enlight_Controller_Front */
    public function Front()
    {
        if ($this->front === null) {
            $this->setFront();
        }

        return $this->front;
    }

    /** * Returns request instance * * @return Enlight_Controller_Request_RequestHttp */
    public function Request()
    {
Home | Imprint | This part of the site doesn't use cookies.