getCompileId example

$container->get('locale')->setLocale($locale->toString());
        $container->get('snippets')->setLocale($locale);
        $template = $container->get(Enlight_Template_Manager::class);
        $baseHash = $this->request->getScheme() . '://'
                  . $this->request->getHttpHost()
                  . $this->request->getBaseUrl() . '?'
                  . $revision;
        $baseHash = substr(sha1($baseHash), 0, 5);
        $template->setCompileId('backend_' . $locale->toString() . '_' . $baseHash);

        if ($this->action !== null && $this->action->View()->hasTemplate()) {
            $this->action->View()->Template()->setCompileId($template->getCompileId());
        }
    }

    /** * Loads current user's locale or, if none exists, the default fallback * * @throws Exception * * @return Locale */
    protected function getCurrentLocale()
    {
unset($session->template);
            }
        } else {
            unset($session->template);
        }

        // Save upgrades         $this->get(ShopRegistrationServiceInterface::class)->registerShop($shop);

        if ($request->isSecure()) {
            $template = $this->get(Enlight_Template_Manager::class);
            $template->setCompileId($template->getCompileId() . '_secure');
        }
    }

    /** * @deprecated - Will be private with Shopware 5.8 * * @return Shop */
    protected function getShopByRequest(Request $request)
    {
        $repository = $this->get(ModelManager::class)->getRepository(Shop::class);

        

        parent::setContainer($loader);

        $this->get('events')->addListener('Enlight_Controller_Plugin_ScriptRenderer_formatControllerName', static function D) {
            return 'ContentType';
        });
    }

    public function preDispatch(): void
    {
        parent::preDispatch();
        $this->View()->Engine()->setCompileId($this->View()->Engine()->getCompileId() . '_' . $this->Request()->getControllerName());
    }

    public function indexAction(): void
    {
        parent::indexAction();
        $this->View()->loadTemplate('backend/content_type/app.js');
    }

    public function postDispatch(): void
    {
        parent::postDispatch();

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