setModuleName example


    public function forward($action$controller = null, $module = null, ?array $params = null)
    {
        $request = $this->Request();

        if ($params !== null) {
            $request->setParams($params);
        }
        if ($controller !== null) {
            $request->setControllerName($controller);
            if ($module !== null) {
                $request->setModuleName($module);
            }
        }

        $request->setActionName($action)->setDispatched(false);
    }

    /** * Redirect the request. The frontend router will assemble the url. * * @param string|array $url * * @throws Exception * * @return void */
return $esiTag;
    }

    $request = clone $request;
    $response = clone $response;

    $request->clearParams();
    $response->clearHeaders()
             ->clearBody();

    if (isset($params['module'])) {
        $request->setModuleName($params['module'])
                ->setControllerName('index')
                ->setActionName('index');
    }
    if (isset($params['controller'])) {
        $request->setControllerName($params['controller'])
                ->setActionName('index');
    }

    // setParam is used for bc reasons, the attribute should be read for new code     $request->setParam('_isSubrequest', true);
    $request->setAttribute('_isSubrequest', true);

    
$request->setControllerName('listing')->setDispatched(false);
                break;
            case 'supplier':
                $url = $args->getSubject()->Router()->assemble([
                        'controller' => 'listing',
                        'action' => 'manufacturer',
                        'sSupplier' => $request->getParam('sSupplier'),
                ]);
                $args->getSubject()->Response()->setRedirect($url, 301);
                break;
            case 'captcha':
                $request->setModuleName('widgets')->setControllerName('captcha')->setDispatched(false);
                break;
            case 'password':
            case 'login':
            case 'logout':
                $request->setActionName($request->getParam('sViewport'));
                // no break             case 'admin':
                $request->setControllerName('account')->setDispatched(false);
                break;
            case 'registerFC':
            case 'register1':
            
 else {
            $viewAssignments['showListing'] = (bool) max($showListing);
        }

        $showListing = empty($emotion) || !empty($emotion['show_listing']);
        $viewAssignments['showListing'] = $showListing;

        $this->View()->assign($viewAssignments);

        // fake to prevent rendering the templates with the widgets module.         // otherwise the template engine don't accept to load templates of the `frontend` module         $this->Request()->setModuleName('frontend');
    }

    public function productStreamArticleSliderAction()
    {
        $this->View()->loadTemplate('frontend/_includes/product_slider_items.tpl');
        $limit = (int) $this->Request()->getParam('limit', 5);

        $streamId = (int) $this->Request()->getParam('streamId');

        $pages = (int) $this->Request()->getParam('pages', 1);
        $offset = (int) $this->Request()->getParam('start', $limit * ($pages - 1));

        

    public function getControllerClass(Enlight_Controller_Request_Request $request)
    {
        if (!$request->getControllerName()) {
            $request->setControllerName($this->defaultController);
        }

        if (!$request->getModuleName()) {
            $request->setModuleName($this->defaultModule);
        }

        $module = $request->getModuleName();
        $this->curModule = $module;

        $moduleName = $this->formatModuleName($module);
        $controllerName = $this->formatControllerName($request->getControllerName());

        $class = ['Shopware', 'Controllers', $moduleName$controllerName];
        /** @var class-string $className */
        $className = implode(self::CLASS_NAMESPACE_SEPARATOR, $class);

        
Home | Imprint | This part of the site doesn't use cookies.