getTemplateVars example

$mail->setFrom($from$fromName);

        $counter = 0;
        foreach ($emails as $email) {
            $user = $this->getMailingUserByEmail($email);
            $template->assign('sUser', $user, true);
            $hash = $this->createHash((int) $user['mailaddressID'](int) $mailing['id']);
            $template->assign('sCampaignHash', $hash, true);
            $template->assign('sRecommendations', $this->getMailingSuggest($mailing['id']$user['userID']), true);

            /** @var array $voucher */
            $voucher = $template->getTemplateVars('sVoucher');
            if (!empty($voucher['id'])) {
                $voucher['code'] = $this->getVoucherCode($voucher['id']);
                $template->assign('sVoucher', $voucher, true);
            }

            if (empty($mailing['plaintext'])) {
                $body = $template->fetch('newsletter/index/' . $mailing['template']$template);
            }
            $bodyText = $template->fetch('newsletter/alt/' . $mailing['template']$template);

            if (!empty($body)) {
                

        if (!$source->exists) {
            if ($_template->parent instanceof Smarty_Internal_Template) {
                $parent_resource = " in '{$_template->parent->template_resource}'";
            } else {
                $parent_resource = '';
            }
            throw new SmartyException("Unable to load template {$source->type} '{$source->name}'{$parent_resource}");
        }

        // prepare variables         extract($_template->getTemplateVars());

        // include PHP template with short open tags enabled         ini_set( 'short_open_tag', '1' );
        include($source->filepath);
        ini_set( 'short_open_tag', $this->short_open_tag );
    }
}

?>
/** @var Shop $shop */
        $shop = $this->container->get('shop');

        $inheritance = $this->container->get('theme_inheritance');

        $templateManager = $this->container->get('template');
        $templateManager->addPluginsDir(
            $inheritance->getSmartyDirectories($shop->getTemplate())
        );

        $themeSettings = $templateManager->getTemplateVars('theme');
        if (!empty($themeSettings)) {
            return;
        }

        $config = $inheritance->buildConfig(
            $shop->getTemplate(),
            $shop,
            false
        );

        $templateManager->assign('theme', $config);
    }
/** * Returns a specified value or all values. * * @param string|null $spec * * @return mixed|array */
    public function getAssign($spec = null)
    {
        if ($this->template !== null) {
            return $this->template->getTemplateVars($spec);
        }

        return $this->engine->getTemplateVars($spec);
    }

    /** * Renders the current template. * * @return string */
    public function render()
    {
return $this->templateExists($tpl_file);
    }

    /** * Returns an array containing template variables * * @param string $name * @return array */
    public function get_template_vars($name=null)
    {
        return $this->getTemplateVars($name);
    }

    /** * Returns an array containing config variables * * @param string $name * @return array */
    public function get_config_vars($name=null)
    {
        return $this->getConfigVars($name);
    }
Home | Imprint | This part of the site doesn't use cookies.