extendsTemplate example

/** * This function extends the internal array with the given template. * * @param string $template_name * * @return Enlight_View_Default */
    public function extendsTemplate($template_name)
    {
        if ($this->template !== null) {
            $this->template->extendsTemplate($template_name);
        }

        return $this;
    }

    /** * Extends a template block by name. * * @param string $mode * * @return Enlight_View_Default */

    public function onBackendIndexPostDispatch(Enlight_Controller_ActionEventArgs $args)
    {
        $args->getSubject()->View()->addTemplateDir(
            __DIR__ . '/Views/'
        );

        // if the controller action name equals "load" we inject our update check         if ($args->getRequest()->getActionName() === 'load') {
            $args->getSubject()->View()->extendsTemplate(
                'backend/index/view/swag_update_menu.js'
            );
        }
    }

    /** * Returns to controller path to our SwagUpdate backend controller * * @return string */
    public function onGetSwagUpdateControllerPath(Enlight_Event_EventArgs $args)
    {
if (\in_array($controller$controllerBlacklist, true)) {
            $metaRobots = 'noindex,follow';
        } elseif (!empty($queryBlacklist)) {
            foreach ($queryBlacklist as $queryKey) {
                if ($request->getQuery($queryKey) !== null) {
                    $metaRobots = 'noindex,follow';
                    break;
                }
            }
        }

        $view->extendsTemplate('frontend/plugins/seo/index.tpl');

        if (!empty($metaRobots)) {
            $view->assign('SeoMetaRobots', $metaRobots);
        }
        if (!empty($metaDescription)) {
            $view->assign('SeoMetaDescription', $metaDescription);
        }

        if (!$request->getParam('error_handler') && $this->get(Shopware_Components_Config::class)->get('hrefLangEnabled')) {
            $context = $this->get(ContextServiceInterface::class)->getShopContext();

            

    public function onBackendOrderPostDispatch(Enlight_Event_EventArgs $args)
    {
        /** @var Enlight_View_Default $view */
        $view = $args->getSubject()->View();

        // if the controller action name equals "load" we have to load all application components         if ($args->getRequest()->getActionName() === 'load') {
            $view->addTemplateDir($this->Path() . 'Views/emotion/');
            $view->extendsTemplate(
                'backend/order/payment_methods/controller/detail.js'
            );
            $view->extendsTemplate(
                'backend/order/payment_methods/view/detail/payment_methods.js'
            );
        }
    }

    /** * Called when the BackendCustomerPostDispatch Event is triggered * * @return void */
Home | Imprint | This part of the site doesn't use cookies.