setParams example

        $params = $context->getParams();
        $params = $this->queryAliasMapper->replaceShortParams($params);

        if (isset($params['sAction'])) {
            $params['action'] = $params['sAction'];
        }

        if (isset($params['sViewport'])) {
            $params['controller'] = $params['sViewport'];
        }

        $context->setParams($params);

        // /widgets and /index supports short request queries         if ($pathInfo === '/' || str_starts_with($pathInfo, '/widgets/')) {
            return $pathInfo;
        }

        $pathInfo = ltrim($pathInfo, '/');
        $route = $this->getRoute($shopId$pathInfo);

        if (!\is_array($route)) {
            return $pathInfo;
        }

        /* @see \Shopware_Controllers_Widgets_Emotion */
        if (!isset($params['module']) && isset($globalParams['module']) && $globalParams['module'] === 'widgets') {
            $params['module'] = 'frontend';
        }
        $params = array_merge($globalParams$params);
        $newParams = [];
        foreach ($params as $key => $param) {
            $newParams[(string) $key] = $param;
        }
        if ($context) {
            $context->setParams($newParams);
        }

        return $newParams;
    }
}
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'])) {
            $front->throwExceptions((bool) $options['throwExceptions']);
        }

        


                $process[$key][$filteredKey] = $v;
            }
        }

        unset($process);
        $request->query->replace($_GET);
        $request->request->replace($_POST);
        $request->cookies->replace($_COOKIE);
        $request->server->replace($_SERVER);
        $request->setParams($userParams);
    }

    /** * Filter value by regex * * @param string $value * @param string $regex * @param bool $stripTags * @param array<string> $allowedHtmlTags * @param array<string> $allowedAttributes * * @return string|null */
 {

                $body->location->start = $tokenBodyStart->location->start;
                $body->location->end = $this->scanner->getPosition();
                $node = $this->createNode(
                    "FunctionDeclaration",
                    $async ?: $token
                );
                if ($id) {
                    $node->setId($id);
                }
                $node->setParams($params);
                $node->setBody($body);
                $node->setGenerator($generator);
                $node->setAsync((bool) $async);
                return $this->completeNode($node);
            }

            $this->error();
        }
        return null;
    }
    
    


    /** * @return void */
    public function updateFromEnlightRequest(EnlightRequest $request)
    {
        $this->setHost($request->getHttpHost());
        $this->setBaseUrl($request->getBaseUrl());
        $this->setSecure($request->isSecure());
        $this->setGlobalParams(self::getGlobalParamsFromRequest($request));
        $this->setParams($request->getQuery());
    }

    /** * @return Context */
    public static function createFromShop(ShopwareShop $shop, ShopwareConfig $config)
    {
        $self = new self(
            $shop->getHost() ?? 'localhost',
            $shop->getBaseUrl() ?? '',
            $shop->getSecure(),
            []

    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->setActionName(isset($params['action']) ? $params['action'] : 'index');
    $request->setParams($params)
            ->setDispatched(true);

    Shopware()->Container()->get('request_stack')->push($request);

    $dispatcher->dispatch($request$response);

    if (!$request->isDispatched() || $response->isRedirect()) {
        // forwards and redirects render nothing         return '';
    }

    

    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);
    }

    
/* For enlight routing */
        $this->context->updateFromEnlightRequest($request);

        $params = $this->match($request->getPathInfo()$this->context);
        if ($params !== false) {
            /* For shopware routing (query === userParams) */
            $request->setQuery($params);
        }

        /* For enlight routing */
        $this->context->updateFromEnlightRequest($request);
        $this->context->setParams([]);

        return $request;
    }

    /** * Sets a global parameter. * * @see \Shopware_Controllers_Backend_Newsletter::initMailing * @see \Enlight_Controller_Router::setGlobalParam * * @param string $name * @param string $value * * @return self */
Home | Imprint | This part of the site doesn't use cookies.