@see Azine\EmailBundle\Services\AzineTemplateProvider::getParamArrayFor()

@param string $template

@return array
555254
protected function getParamArrayFor($template)
    {
        // get the style-params from the parent (if you like)
        $newVars = parent::getParamArrayFor($template);

        // If you configured two SwiftMailers, one with spooling and one without, then
        // all templates that have set the "SEND_IMMEDIATELY_FLAG = true" will be sent with the
        // mailer that does not use spooling => faster email delivery => e.g. for the Reset-Password-Email.
        if (self::VIP_INFO_MAIL_TEMPLATE == $template) {
            $newVars[self::SEND_IMMEDIATELY_FLAG] = true;
        }

        // add template specific stuff
        if (self::NOTIFICATIONS_TEMPLATE == $template) {
            $newVars['%someUrl%'] = 'http://example.com'; 				//$this->router->generate("your_route", $routeParamArray, UrlGeneratorInterface::ABSOLUTE_URL);
            $newVars['%someOtherUrl%'] = 'http://example.com/other';	//$this->router->generate("your_route", $routeParamArray, UrlGeneratorInterface::ABSOLUTE_URL);
        }

        // override some generic stuff needed for all templates
        $newVars['h2Style'] = "style='padding:0; margin:0; font:bold 24px Arial; color:red; text-decoration:none;'";

        // add an image that should be embedded into the html-email.
        $newVars['someRandomImage'] = $this->getTemplateImageDir().'someRandomImage.png';
        // after the image has been added here, it will be base64-encoded so it can be embedded into a html-snippet
        // see self::getSnippetArrayFor()

        return $newVars;
    }
675466
public function publish($template): string
    {
        $template = $template instanceof Template ? $template : Template::fromArray($template);

        $response = $this->client->publishTemplate($template);

        $etag = $response->getHeader('ETag');

        return array_shift($etag);
    }
837038
public function getTemplateQuery($template)
    {
        if(isset($this->template[$template]))
        {
            return $this->template[$template];
        }

        return FALSE;
    }
284655
public function getEngineForTemplate($template)
    {
        if ($this->engine instanceof DelegatingEngine) {
            return $this->prepareEngine($this->engine->resolveEngine($template));
        }

        if ($this->engine->supports($template)) {
            return $this->prepareEngine($this->engine);
        }

        throw new \InvalidArgumentException(sprintf('No engine found for template "%s".', (string)$template));
    }
1218420
public static function getLastCode($template = "")
    {
        $array = debug_backtrace();
        unset($array[0]);

        $code = "";
        foreach ($array as $row) {
            if (isset($row['file']) && isset($row['line'])) {
                if ($template == "") {
                    $code = " in file '" . $row['file'] . "' on line " . $row['line'];
                } else {
                    $code = strtr($template, [
                        "{file}" => $row['file'],
                        "{line}" => $row['line'],
                    ]);
                }
                break;
            }
        }

        return $code;
    }
866379
protected function findTemplateInPaths($template)
    {
        if (file_exists($template)) {
            return $template;
        }

        foreach ($this->paths as $path) {
            if (file_exists($realpath = $path . DIRECTORY_SEPARATOR . ltrim($template, DIRECTORY_SEPARATOR))) {
                return $realpath;
            }
        }

        return false;
    }
963915
private function combine ($template)
	{
		ob_start();

		foreach (self::$shares as $k => $v) {
			${$k} = $v;
		}

		foreach ($this->values as $k => $v) {
			${$k} = $v;
		}

		if ($ctlbtmpltfiles = $this->getFilenames($template, true)) {
			foreach ($ctlbtmpltfiles as $ctlbtmpltfile) {
				include $ctlbtmpltfile;
			}
		}

		$val = ob_get_contents();
		ob_end_clean();

		return $val;
	}
1218960
protected function parseTemplate($template, array $vars = array())
    {
        if (strpos($template, '{') === false) {
            return $template;
        }

        if (preg_match_all('@\{\$([A-Za-z0-9_]+)\}@i', $template, $matches)) {
            foreach ($matches[1] as $varName) {
                $template = str_replace('{$' . $varName . '}', $vars[$varName], $template);
            }
        }

        return $template;
    }
585672
protected function load(string $template, array $data): string
    {
        extract($data);

        $buffer = "";
        ob_start();
        include $this->templateDir . $template;
        $buffer = ob_get_contents();
        ob_end_clean();
        return $buffer;
    }
1167426
protected static function transform_template_brief(template $template) {
        global $OUTPUT;
        $exporter = new \core_competency\external\template_exporter($template);
        $data = $exporter->export($OUTPUT);
        return [
            'name' => $data->shortname,
            'description' => $data->description
        ];
    }
635766
protected function recursiveRender($template)
    {
        $output = '';
        foreach ($template as $val) {
            if (is_array($val)) {
                $output .= $this->recursiveRender($val);
            } else {
                $output .= $val;
            }
        }

        return $output;
    }
746146
protected function compiled($template)
    {
        $template = ltrim($template, '/');
        if (strrchr($template, '.') == $this->extension)
            $template = substr($template, 0, -strlen($this->extension));
        $file = $this->dir . DIRECTORY_SEPARATOR . $template . $this->extension;
        if (!is_file($file))
            throw new \RuntimeException("template not found:$file!");

        $modified = filemtime($file);
        $compiled = $this->temp . DIRECTORY_SEPARATOR . $template . ".{$modified}.php";
        if (!$this->debug && is_file($compiled) && filemtime($compiled) >= $modified)
            return $compiled;

        $content = self::compile(file_get_contents($file), $this->left, $this->right);
        self::writeFile($compiled, $content, $this->temp);

        return $compiled;
    }
977605
public function template($template = null)
    {
        if (is_null($template)) {
            return $this->template;
        } else {
            $this->template = $template;
        }
    }
642630
public function validateTemplate(array $template): array
    {
        $resolver = new OptionsResolver();
        $resolver->setRequired([
            'form',
        ]);
        $resolver->setDefaults([
            'tabs' => false,
            'container' => false,
        ]);
        $resolver->setAllowedTypes('form', 'array');
        $resolver->setAllowedTypes('tabs', ['boolean', 'array']);
        $resolver->setAllowedTypes('container', ['boolean', 'array']);

        $this->template = $resolver->resolve($template);
        
        $this->template['form'] = $this->validateForm($this->template['form']);
        $this->template['container'] = $this->validateContainer($this->template['container']);
        $this->template['tabs'] = $this->validateTabs($this->template['tabs']);

        if ($this->template['container'] === false && $this->template['tabs'] === false)
            trigger_error(sprintf('The form must specify a container or a set of tabs.'),E_USER_ERROR);

        return $this->template;
    }
804930
public function find($template)
    {
        is_array($template) and $template = array_filter($template, 'is_string');
        if ((! is_string($template) && ! is_array($template)) || empty($template)) {
            throw new InvalidArgumentException(
                'Template name must be a string or an array of strings.'
            );
        }
        if (is_array($template)) {
            return $this->findMany($template);
        }
        $parse = $this->parseName($template);
        if ($parse['dir']) {
            return $this->findInDir($parse['dir'], $parse['file']);
        }

        return $parse['file'] ? $this->scanFor($parse['file']) : false;
    }
1228307
public function getTemplateFile($template)
	{
	    if (!is_file($template)) {
	        $template = $this->getTemplatePath() . $this->_getRelativeTemplate($template) . $this->getSuffix();
	    }
	    
	    return $template;
	}
1186721
protected static function fetchTemplate( $template, $parameters = array() )
    {
        $tpl = eZTemplate::factory();
        $existingPramas = array();

        foreach( $parameters as $name => $value )
        {
            if ( $tpl->hasVariable( $name ) )
                $existingPramas[$name] = $tpl->variable( $name );

            $tpl->setVariable( $name, $value );
        }

        $result = $tpl->fetch( $template );

        foreach( $parameters as $name => $value )
        {
            if ( isset( $existingPramas[$name] ) )
                $tpl->setVariable( $name, $existingPramas[$name] );
            else
                $tpl->unsetVariable( $name );
        }

        return $result;
    }