getParam example

$this->View()->assign([
            'success' => true,
            'data' => $presets,
        ]);
    }

    /** * @return void */
    public function previewAction()
    {
        $id = $this->Request()->getParam('id');

        if (!$id) {
            $this->View()->assign([
                'success' => false,
            ]);

            return;
        }

        $previewData = $this->container->get(ModelManager::class)->getRepository(Preset::class)->createQueryBuilder('preset')
            ->select('preset.presetData, preset.preview')
            
$this->refreshPartner($request$response);
        }
    }

    /** * @param Enlight_Controller_Request_Request $request * * @return void */
    public function refreshBasket(Enlight_Controller_Request_RequestHttp $request)
    {
        $currentController = $request->getParam('requestController', $request->getControllerName());
        $sessionId = (string) $request->getSession()->getId();

        if (!empty($currentController) && !empty($sessionId)) {
            $userId = (int) $request->getSession()->get('sUserId');
            $userAgent = (string) $request->getServer('HTTP_USER_AGENT');
            $sql = ' UPDATE s_order_basket SET lastviewport = ?, useragent = ?, userID = ? WHERE sessionID=? ';
$this->resource = $country;
        parent::__construct();
    }

    /** * Get list of countries * * GET /api/countries */
    public function indexAction(): void
    {
        $limit = (int) $this->Request()->getParam('limit', 1000);
        $offset = (int) $this->Request()->getParam('start', 0);
        $sort = $this->Request()->getParam('sort', []);
        $filter = $this->Request()->getParam('filter', []);

        $result = $this->resource->getList($offset$limit$filter$sort);

        $this->View()->assign($result);
        $this->View()->assign('success', true);
    }

    /** * Get one country * * GET /api/countries/{id} */
$this->View()->setScope(Enlight_Template_Manager::SCOPE_PARENT);
        $this->articles = Shopware()->Modules()->Articles();
    }

    public function indexAction()
    {
        $this->View()->assign('sComparisons', $this->articles->sGetComparisons());
    }

    public function addArticleAction()
    {
        if (($productId = $this->Request()->getParam('articleID')) !== null) {
            $this->View()->assign('sCompareAddResult', $this->articles->sAddComparison($productId));
        }
        $this->View()->assign('sComparisons', $this->articles->sGetComparisons());
    }

    public function deleteArticleAction()
    {
        if (($productId = $this->Request()->getParam('articleID')) !== null) {
            $this->articles->sDeleteComparison((int) $productId);
        }
        $this->forward('index');
    }
/** * On index - get all Resources that we need in backend area * Backend Menu * Licence Information * Rss-Data for example * * @return void */
    public function indexAction()
    {
        // Script renderer         if ($this->Request()->getParam('file') !== null) {
            return;
        }

        // Check session         try {
            $auth = $this->auth->checkAuth();
        } catch (Exception $e) {
            $auth = null;
        }

        // No session

    public function getTaxesAction()
    {
        $repository = $this->get('models')->getRepository(Tax::class);

        $query = $repository->getTaxQuery(
            $this->Request()->getParam('filter', []),
            $this->Request()->getParam('sort', []),
            $this->Request()->getParam('start'),
            $this->Request()->getParam('limit')
        );

        // Get total result of the query         $total = $this->get('models')->getQueryCount($query);

        // Select all shop as array         $data = $query->getArrayResult();

        
$this->viewRenderer->Action()->View()->loadTemplate($template);

        foreach ($this->headers as $name => $value) {
            if ($name === 'Expires' && $value === null) {
                $value = Zend_Date::now()->addMonth(1)->get(Zend_Date::RFC_1123);
            } elseif ($name === 'Last-Modified' && $value === null) {
                $value = Zend_Date::now();
                $value = $value->get(Zend_Date::RFC_1123);
            } elseif ($name === 'Content-Type' && $value === null) {
                $front = $args->getSubject()->Front();
                $value = 'application/javascript; charset=' . $front->getParam('charset');
            }

            $this->viewRenderer->Action()->Response()->headers->set($name$value, true);
        }
    }

    /** * Sets the render flag. Loads the view renderer. * * @param bool $flag * * @return Enlight_Controller_Plugins_ScriptRenderer_Bootstrap */
public function onPostDispatch(Enlight_Controller_ActionEventArgs $args): void
    {
        $config = $this->Config();

        if (!$config->get('show')) {
            return;
        }

        $view = $args->getSubject()->View();
        $parent = (int) $this->get('shop')->get('parentID');
        $categoryId = (int) $args->getRequest()->getParam('sCategory', $parent);

        $menu = $this->getAdvancedMenu($parent$categoryId(int) $config->get('levels'));

        $view->assign('sAdvancedMenu', $menu);
        $view->assign('columnAmount', $config->get('columnAmount'));

        $view->assign('hoverDelay', $config->get('hoverDelay'));

        $view->addTemplateDir($this->Path() . 'Views');
    }

    

        $default = $this->modelManager->getRepository(Shop::class)->getActiveDefault();

        return (string) $default->getHost();
    }

    /** * Check the date of the last subscription-check var */
    private function isPluginsSubscriptionCookieValid(Request $request): bool
    {
        if ($request->getParam('force')) {
            return true;
        }

        $lastCheck = $request->getCookie('lastCheckSubscriptionDate');

        return $lastCheck !== date('dmY');
    }

    /** * Get all plugins with name and version * * @return array<array<string, string>> */

    public function preDispatch()
    {
        $this->View()->setScope(Enlight_Template_Manager::SCOPE_PARENT);
    }

    /** * Will be called when no action is supplied */
    public function indexAction()
    {
        $sTarget = $this->Request()->getParam('sTarget', 'account');
        $sTargetAction = $this->Request()->getParam('sTargetAction', 'index');

        $this->View()->assign([
            'sTarget' => $sTarget,
            'sTargetAction' => $sTargetAction,
            'sEsd' => Shopware()->Modules()->Basket()->sCheckForESD(),
            'showNoAccount' => $this->Request()->getParam('showNoAccount', false),
            'accountMode' => $this->Request()->getParam('skipLogin'),
        ]);

        if ($this->shouldRedirectToAccount()) {
            
$this->View()->assign($result);
        $this->View()->assign('success', true);
    }

    /** * Get one cache * * GET /api/caches/{id} */
    public function getAction(): void
    {
        $id = $this->Request()->getParam('id');

        $cache = $this->resource->getOne($id);

        $this->View()->assign('data', $cache);
        $this->View()->assign('success', true);
    }

    /** * Creating caches is not possible * * @throws RuntimeException */
 else {
            $mail = $container->get(Shopware_Components_TemplateMail::class)->createMail('sOPTINREGISTER', $context);
        }
        $mail->addTo($customer->getEmail());
        $mail->send();
    }

    private function doubleOptInSaveHash(Customer $customer, string $hash): int
    {
        /** @var Request|null $request */
        $request = Shopware()->Container()->get('front')->Request();
        $fromCheckout = $request && $request->getParam('sTarget') === 'checkout';

        $sql = "INSERT INTO `s_core_optin` (`type`, `datum`, `hash`, `data`) VALUES ('swRegister', ?, ?, ?)";

        // Needs to be compatible with the sREGISTERCONFIRMATION context         $mailContext = [
            'email' => $customer->getEmail(),
            'sMAIL' => $customer->getEmail(),
            'firstname' => $customer->getFirstname(),
            'lastname' => $customer->getLastname(),
            'salutation' => $customer->getSalutation(),
            

    public function onPreDispatch(Enlight_Controller_EventArgs $args)
    {
        $request = $args->getRequest();
        $response = $args->getResponse();

        if ($response->isException()
            || $request->isPost()
            || $request->isXmlHttpRequest()             // is a ajax call             || $request->has('callback')                // is a jsonp call             || $request->getModuleName() != 'frontend'  // is not frontend             || !$request->getParam('rewriteAlias')      // is not a rewrite url alias         ) {
            return;
        }
        $router = $args->getSubject()->ensureRouter();

        $query = $request->getQuery();
        $location = $router->assemble($query);

        // Fix shop redirect / if it's not a seo url         if (preg_match('#\/[0-9]+$#', $location$match) > 0) {
            $location = $request->getBaseUrl() . '/';
        }

    }

    /** * Event listener function of the listing store of the emotion backend module. * Returns an array of all defined emotions. * * @return void */
    public function listAction()
    {
        $limit = (int) $this->Request()->getParam('limit');
        $offset = (int) $this->Request()->getParam('start', 0);
        $filter = $this->Request()->getParam('filter');
        $filterBy = $this->Request()->getParam('filterBy');
        $categoryId = $this->Request()->getParam('categoryId');

        $query = $this->getRepository()->getListingQuery($filter$filterBy$categoryId);

        $query->setFirstResult($offset)
            ->setMaxResults($limit);

        $emotions = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        
/** * Event listener function of the product backend module. Fired when the user * edit or create an product and clicks the save button which displayed on bottom of the product * detail window. */
    public function saveAction()
    {
        $data = $this->Request()->getParams();

        if ($this->Request()->has('id')) {
            $productId = (int) $this->Request()->getParam('id');
            $product = $this->getRepository()->find($productId);
            if (!$product instanceof Product) {
                throw new ModelNotFoundException(Product::class$productId);
            }

            // Check whether the product has been modified in the meantime             try {
                $lastChanged = new DateTime($data['changed']);
            } catch (Exception $e) {
                // If we have a invalid date caused by product imports                 $lastChanged = $product->getChanged();
            }
Home | Imprint | This part of the site doesn't use cookies.