extendsBlock example

$view->addTemplateDir($templateDir);
        $backendPath = $templateDir . 'backend/';
        if (!file_exists($backendPath)) {
            return;
        }

        $directoryIterator = new DirectoryIterator($backendPath);
        $regex = new RegexIterator($directoryIterator, '/^.+\.js$/i', RecursiveRegexIterator::GET_MATCH);
        foreach ($regex as $file) {
            $path = 'backend/' . $file[0];
            $view->extendsBlock(
                'backend/Emotion/app',
                PHP_EOL . '{include file="' . $path . '"}',
                'append'
            );
        }
    }

    public function registerWidgetTemplates(Enlight_Event_EventArgs $args)
    {
        /** @var Enlight_View_Default $view */
        $view = $args->get('subject')->View();

        
/** * Extends a template block by name. * * @param string $mode * * @return Enlight_View_Default */
    public function extendsBlock($spec$content$mode)
    {
        if ($this->template !== null) {
            $this->Template()->extendsBlock($spec$content$mode);
        }

        return $this;
    }

    /** * Checks if the Enlight_Template_Manager stored the given template. * * @param string $template_name * * @return bool */


        $backendPath = $this->getExistingBackendEmotionPath();
        if (!\is_string($backendPath)) {
            return;
        }

        $directoryIterator = new DirectoryIterator($backendPath);
        $regex = new RegexIterator($directoryIterator, '/^.+\.js$/i', RecursiveRegexIterator::GET_MATCH);
        foreach ($regex as $file) {
            $path = 'backend/' . $file[0];
            $view->extendsBlock(
                'backend/Emotion/app',
                PHP_EOL . '{include file="' . $path . '"}',
                'append'
            );
        }
    }

    /** * Removes the snippets present in the plugin's ini files * from the database * * @param bool $removeDirty if true, the snippets changed by the * shop owner will also be removed */
Home | Imprint | This part of the site doesn't use cookies.