Returns the template resources vars.

@param array $extra
@throws \RuntimeException
@return array
326863
public function getTemplateVars(array $extra = [])
    {
        $extraKeys = array_keys($extra);
        if (0 < count($extraKeys)) {
            foreach (array_keys($this->resources) as $key) {
                if (array_key_exists($key, $extraKeys)) {
                    throw new \RuntimeException(sprintf('Key "%s" used in extra template vars overrides a resource key.', $key));
                }
            }
            foreach (['identifiers', 'resource_name', 'resource_id', 'route_prefix'] as $key) {
                if (array_key_exists($key, $extraKeys)) {
                    throw new \RuntimeException(sprintf('Key "%s" is reserved and cannot be used in extra template vars.', $key));
                }
            }
        }

        return array_merge($this->resources, [
            'identifiers'   => $this->getIdentifiers(),
            'resource_name' => $this->config->getResourceName(),
            'resource_id'   => $this->config->getId(),
            'route_prefix'  => $this->config->getRoutePrefix(),
            'form_template' => $this->config->getTemplate('_form.html'),
        ], $extra);
    }
619692
public function getTemplates($dc)
	{
		$prefix = '';

		if($dc instanceof \MultiColumnWizard)
		{
			$dc->field = $dc->strField;
			$dc->table = $dc->strTable;
		}

		if(isset($GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templatePrefix']))
		{
			$prefix = $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templatePrefix'];
		}

		$key = null;

		if(isset($GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templateThemeId']))
		{
			$key = $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templateThemeId'];
		}

		$key = $key == '' ? null : $dc->activeRecord->$key;

		return $this->getTemplateGroup($prefix, $key);
	}
73179
public function getSshArgs(array $extraOptions = [])
    {
        $options = array_merge($this->getSshOptions(), $extraOptions);

        $args = [];
        foreach ($options as $name => $value) {
            $args[] = '-o';
            $args[] = $name . ' ' . $value;
        }

        return $args;
    }
894785
public function getTemplate($code)
    {
        if (!isset($this->templates[$code])) {
            throw new \RuntimeException(sprintf('No template references with the code : %s', $code));
        }

        return $this->templates[$code];
    }
1346662
public function render($template, array $additionalVariables = null)
    {
        $variables = $this->getVariables();

        // Pass the helper to the template:
        $variables["tpl"] = $this;

        if ($additionalVariables !== null) {
            $variables = array_replace($variables, $additionalVariables);
        }

        call_user_func(function () {
            extract(func_get_arg(1));
            require func_get_arg(0);
        }, $template, $variables);
    }
35992
public function getVariableRefs()
	{
		$result = $this->dateXPath2expression instanceof XPath2Expression
			? $this->dateXPath2expression->getParameterQNames()
			: array();

		if ( $this->timeXPath2expression && $this->timeXPath2expression instanceof XPath2Expression )
		{
			$result = array_merge( $result, $this->timeXPath2expression->getParameterQNames() );
		}

		return $result;
	}
432913
public function getTemplateResources()
    {
        return new TemplateResources(
            $this->stylesheets,
            $this->headerScripts,
            $this->headerIncludes,
            $this->footerScripts,
            $this->footerIncludes
        );
    }
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;
    }
880765
public static function getClientConfigUrl($extraParameters = array()){
        $context = \Context::getInstance();
        $clientConfigParams = [
            'extension' => $context->getExtensionName(),
            'module'    => $context->getModuleName(),
            'action'    => $context->getActionName()
        ];

        return _url('config', 'ClientConfig', 'tao', array_merge($clientConfigParams, $extraParameters));
    }
351458
public function getTemplateContent($template, array $variables)
    {
        $dir = dirname($template);
        $file = basename($template);

        $twig = new \Twig_Environment(new \Twig_Loader_Filesystem(array($dir)), array(
            'debug'            => true,
            'cache'            => false,
            'strict_variables' => true,
            'autoescape'       => false,
        ));
        return $twig->render($file, $variables);
    }
312782
public function getExtraTemplates($view)
    {
        if (empty($this->extraTemplates[$view])) {
            $this->extraTemplates[$view] = [];
        }

        return $this->extraTemplates[$view];
    }
885826
public function getPossibleViewFilesFromTemplates($templates)
    {
        return call_user_func_array('array_merge', array_map(function ($template) {
            return array_map(function ($extension) use ($template) {
                return str_replace('.', '/', $template).'.'.$extension;
            }, $this->extensions);
        }, $templates));
    }
1003473
public function getAllTemplates()
    {
        $strCacheDir = $this->container->getParameter('kernel.cache_dir');

        // Try to load from cache
        if (file_exists($strCacheDir.'/contao/config/twig-templates.php')) {
            self::$twigFiles = include $strCacheDir.'/contao/config/twig-templates.php';

            return self::$twigFiles;
        }

        $bundles = $this->kernel->getBundles();

        if (\is_array($bundles)) {
            foreach (array_reverse($bundles) as $key => $value) {
                $path = $this->kernel->locateResource("@$key");

                $dir = rtrim($path, '/').'/Resources/views';

                if (!is_dir($dir)) {
                    continue;
                }
                $finder = new Finder();
                $twigKey = preg_replace('/Bundle$/', '', $key);

                foreach ($finder->in($dir)->files()->name('*.twig') as $file) {
                    /** @var SplFileInfo $file */
                    $name = $file->getBasename();
                    $legacyName = false !== strpos($name, 'html.twig') ? $file->getBasename('.html.twig') : $name;

                    if (isset(self::$twigFiles[$name])) {
                        continue;
                    }

                    self::$twigFiles[$name] = "@$twigKey/".$file->getRelativePathname();

                    if ($legacyName !== $name) {
                        self::$twigFiles[$legacyName] = self::$twigFiles[$name];
                    }
                }
            }
        }

        foreach ($this->container->get('contao.resource_finder')->findIn('templates')->name('*.twig') as $file) {
            $name = $file->getBasename();
            $legacyName = false !== strpos($name, 'html.twig') ? $file->getBasename('.html.twig') : $name;

            /* @var SplFileInfo $file */
            self::$twigFiles[$name] = $file->getRealPath();

            if ($legacyName !== $name) {
                self::$twigFiles[$legacyName] = self::$twigFiles[$name];
            }
        }

        // add root templates
        $rootTemplates = $this->findTemplates($this->containerUtil->getProjectDir().'/templates/');

        if (\is_array($rootTemplates)) {
            foreach ($rootTemplates as $file) {
                $name = basename($file);
                $legacyName = false !== strpos($name, 'html.twig') ? basename($file, '.html.twig') : $name;

                self::$twigFiles[$name] = $file;

                if ($legacyName !== $name) {
                    self::$twigFiles[$legacyName] = self::$twigFiles[$name];
                }
            }
        }

        return self::$twigFiles;
    }
1173669
private static function getExtraConfig(Event $event) : array
    {
        $extra = $event->getComposer()->getPackage()->getExtra();
        return is_array($extra) ? $extra : [];
    }
35196
public function addTemplateVariablesFor($template, array $contentVariables)
    {
        if (!array_key_exists($template, $this->paramArrays)) {
            $this->paramArrays[$template] = $this->getParamArrayFor($template);
        }

        // add vars for main template
        $contentVariables = array_merge($this->paramArrays[$template], $contentVariables);

        // add the template-variables to the contentItem-params-arrays
        if (array_key_exists(self::CONTENT_ITEMS, $contentVariables)) {
            foreach ($contentVariables[self::CONTENT_ITEMS] as $key => $contentItem) {
                // get the key (=> template)
                reset($contentItem);
                $itemTemplate = key($contentItem);

                // get the params
                $itemParams = $contentItem[$itemTemplate];

                // add params for this template
                $contentItem[$itemTemplate] = $this->addTemplateVariablesFor($itemTemplate, $itemParams);

                // store back into the main array
                $contentVariables[self::CONTENT_ITEMS][$key] = $contentItem;
            }
        }

        return $contentVariables;
    }
1123513
public function getJobTemplateTaskTemplateList($jobTemplate)
    {
        $jobTemplateId = Utilities::getEntityId(
            $jobTemplate,
            'WindowsAzure\MediaServices\Models\JobTemplate'
        );

        $propertyList = $this->_getEntityList(
            "JobTemplates('{$jobTemplateId}')/TaskTemplates"
        );
        $result = [];

        foreach ($propertyList as $properties) {
            $result[] = TaskTemplate::createFromOptions($properties);
        }

        return $result;
    }
800587
protected function exportInternal()
    {
        $properties = [];

        // Export the configuration & $template
        if (!$this->config) {
            throw new \RuntimeException('Invalid configuration', 1481363496);
        }

        $properties['config']    = $this->config;
        $properties['template']  = $this->template;
        $properties['extension'] = $this->extension;

        // Export the associated resources
        if (count($this->resources)) {
            $properties['resources'] = $this->resources;
        }

        // Export the notice
        if (strlen(trim($this->notice))) {
            $properties['notice'] = trim($this->notice);
        }

        // If this is the default variant
        if (!$this->variant) {
            $preview = trim(strval($this->preview));
            if (strlen($preview)) {
                $properties['preview'] = $preview;
            }
        }

        return $properties;
    }