getSnippetNamespace example


    public function getSnippetContent(Smarty_Template_Source $source)
    {
        $_rdl = preg_quote($source->smarty->right_delimiter);
        $_ldl = preg_quote($source->smarty->left_delimiter);

        $_block_namespace = $this->getSnippetNamespace($source);

        $pattern = "!{$_ldl}s(e?)(\s.+?)?{$_rdl}(.*?){$_ldl}/se?{$_rdl}!msi";
        while (preg_match($pattern$source->content, $_block_match, PREG_OFFSET_CAPTURE)) {
            $_block_editable = !empty($_block_match[1][0]);
            $_block_args = $_block_match[2][0];
            $_block_default = $_block_match[3][0];
            list($_block_tag$_block_start) = $_block_match[0];
            $_block_length = \strlen($_block_tag);
            if (!preg_match("!(.?)(name=)(.*?)(?=(\s|$))!", $_block_args$_match) && empty($_block_default)) {
                throw new SmartyException('"' . $_block_tag . '" missing name attribute');
            }
            

    private function synchronizeSnippets(Template $template)
    {
        $directory = $this->pathResolver->getSnippetDirectory($template);

        if (!file_exists($directory) || !$this->snippetConfig['writeToDb']) {
            return;
        }

        $namespace = $this->util->getSnippetNamespace($template);

        $this->snippetWriter->loadToDatabase(
            $directory,
            false,
            $namespace
        );
    }

    /** * Helper function which returns the theme information of the * passed theme. * Used to update the Shopware\Models\Shop\Template entity with * the theme data. * * @return array */
->andWhere('plugin.source != :source')
            ->setParameter(':source', 'Default')
            ->setParameter(':names', ['PluginManager', 'StoreApi'], Connection::PARAM_STR_ARRAY);

        return $query->execute()->fetchAllAssociative();
    }

    private function getPluginStateDescription(bool $inStore, bool $available): string
    {
        switch (true) {
            case $inStore && $available:
                return $this->getSnippetNamespace()->get('controller/plugin_compatible', 'The author of the plugin marked the plugin as compatible.');
            case $inStore && !$available:
                return $this->getSnippetNamespace()->get('controller/plugin_not_compatible', 'The author of the plugin did not mark the plugin as compatible with the shopware version');
            default:
                return $this->getSnippetNamespace()->get('controller/plugin_not_in_store', 'The plugin is not available in the store.');
        }
    }
}
$value = new Value();
        $collection->add($value);

        return $value;
    }

    /** * Returns the snippet namespace for the passed template. */
    private function getConfigSnippetNamespace(Template $template): Enlight_Components_Snippet_Namespace
    {
        return $this->snippets->getNamespace($this->util->getSnippetNamespace($template) . 'backend/config');
    }
}
Home | Imprint | This part of the site doesn't use cookies.