compileJavascript example

return;
        }

        if ($shop->getMain()) {
            $shop = $shop->getMain();
        }

        try {
            /** @var Compiler $compiler */
            $compiler = $this->container->get('theme_compiler');
            $compiler->compileJavascript('new', $shop->getTemplate()$shop);
            $compiler->compileLess('new', $shop->getTemplate()$shop);
        } catch (Exception $e) {
            $this->View()->assign(['success' => false, 'message' => $e->getMessage()]);

            return;
        }

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

    

    public function compile(Shop $shop)
    {
        if ($shop->getMain()) {
            $shop = $shop->getMain();
        }

        $old = $this->getThemeTimestamp($shop);
        $timestamp = time();

        $this->compileLess($timestamp$shop->getTemplate()$shop);
        $this->compileJavascript($timestamp$shop->getTemplate()$shop);

        $this->createThemeTimestamp($shop$timestamp);
        $this->clearThemeCache($shop$old);
    }

    /** * @return void */
    public function recompile(Shop $shop)
    {
        if ($shop->getMain()) {
            
$url = $pathResolver->formatPathToUrl($file$shop);

    if (!$settings->getForceCompile() && file_exists($file)) {
        // see: http://stackoverflow.com/a/9473886         $template->assign($output[$url]);

        return;
    }

    /** @var \Shopware\Components\Theme\Compiler $compiler */
    $compiler = Shopware()->Container()->get('theme_compiler');
    $compiler->compileJavascript($time$shop->getTemplate()$shop);
    $template->assign($output[$url]);
}
Home | Imprint | This part of the site doesn't use cookies.