Renders and set as html the template with the given context

@param
$template
@param array $data
182903
public function useTwigTemplate($template, array $data = array())
	{
		$html = $this->renderer->render($template, $data);
		$this->setHtml($html);
		return $this;
	}
945529
public function render(View $template, array $data = array())
    {
        if (! empty($this->data)) {
            $data = array_merge($this->data, $data);
        }

        // Load file into string
        $source = file_get_contents($template->getFullPath());

        if ($source === false) {
            throw new FileNotFoundException("View file '" . $template->getFullPath() . "' is not found!"); // @codeCoverageIgnore
        }

        return $this->environment->render($template->getPath(), $data);
    }
982833
protected static function textInsertion($template, array $data)
    {
        $replacements = [];
        foreach($data as $key => $value)
        {
            $replacements['{{' . $key . '}}'] = $value;
        }

        return strtr($template, $replacements);
    }
701316
protected function render($templates, array $data = array())
    {
        $content = $this->view->render($templates, $data);
        $response = new Response();
        $response->setContent($content);

        return $response;
    }
837253
protected function responseTemplate($template, $data = array()){
        
        if(!isset(hubert()->template)){
            throw new \Exception("no template engine installed");
        }
        $html = hubert()->template->render($template, $data);
        $this->_response->getBody()->write($html);
        
        return $this->_response;
        
    }
1227537
public function render($controller, $template, $data)
    {
        $view = new View($controller);
        $css = array();
        $html = $view->mail($template, $data, $css);
        $cssToInlineStyles = new CssToInlineStyles();
        $cssToInlineStyles->setCSS($this->getCss($css));
        $cssToInlineStyles->setHTML($html);
        return $cssToInlineStyles->convert();
    }
1267502
public static function Render($template=null, $data=null)
    {
        if ($template && $data) {
            return self::$renderer->render($template, $data);
        } else {
            self::$data = self::getData();
            self::$templates[] = "index";
            self::loadTemplate(self::$templates);
        }
    }
235688
public function render(string $template, array $data = []): string
	{
		$data = array_merge($this->data, $data);

		return $this->getRenderer()->make($template, $data)->render();
	}
838976
public function renderTemplate($templatePath = null, $data = [])
    {
        $templateData = $this->readTemplate($templatePath);
        if($data === null) {
            throw new Exception("template(): expects parameter 2 to be array, null given");
        }
        foreach($data as $key => $val) {
            if(is_array($val)) {
                $findStart = strpos($templateData, '{{'.$key.':}}');
                if($findStart !== false) {
                    $findEnd = strpos($templateData, '{{:'.$key.'}}');
                    if($findEnd !== false) {
                        $len = 5 + strlen($key);
                        $substr = substr($templateData, $findStart, ($findEnd - $findStart));
                        $substr = substr($substr, $len);
                        $loopstr = []; #fixed-for: Uncaught Error: [] operator not supported for strings $loopstr[]
                        foreach($val as $k => $v) {
                            $temp = $substr;
                            if(is_array($v)) {
                                //$temp = strtr($temp, $v); {{}} not replaced
                                foreach($v as $ks => $vs) {
                                    $temp = str_replace('{{'.$ks.'}}', $vs, $temp);
                                }
                            }
                            else {
                                $temp = str_replace('{{'.$key.'}}', $v, $temp);
                            }
                            $loopstr[] = $temp;
                        }
                        $loopstr = implode("\n", $loopstr);
                        $templateData = str_replace('{{'.$key.':}}'.$substr.'{{:'.$key.'}}', $loopstr, $templateData);
                    }
                    else {
                        throw new Exception('Error in template : loop has not closed properely');
                        exit;
                    }
                }
            }
            else {
                $templateData = str_replace('{{'.$key.'}}', $val, $templateData);
            }
        }
        return $templateData;
    }
186565
public function compile($template, $data = array())
    {
        $compiler = new BladeCompiler($this->files, 'theme');

        // Get blade compiler.
        $parsed = $compiler->compileString($template);

        ob_start() and extract($data, EXTR_SKIP);
        try {
            eval('?>'.$parsed);
        } catch (\Exception $e) {
            ob_end_clean(); throw $e;
        }
        $template = ob_get_contents();
        ob_end_clean();

        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;
    }
332885
protected function renderTemplate($input, $outputFile, $template, $templates, $data = [])
    {
        $paths = [$templates];

        if ($templates = $input->getOption('templates')) {
            $paths []= $templates;
        }

        $paths = array_filter($paths);

        $loader = new Twig_Loader_Filesystem($paths);
        $twig = new Twig_Environment($loader);


        $template = $twig->loadTemplate($template);

        $dataOption = $input->getOption('data');

        if (file_exists($dataOption)) {
            $dataOption = file_get_contents($dataOption);
        }

        $dataOption = json_decode(stripcslashes($dataOption), true);

        if (!is_array($dataOption)) {
            $dataOption = [];
        }

        $data = array_merge($data, $dataOption);

        @mkdir(dirname($outputFile), 0755, true);
        file_put_contents($outputFile, $template->render($data));
    }
203523
public function render($source, array $data = array())
    {
        parent::render($source, $data);

        //Load the template
        if($this->getObject('filter.path')->validate($source))
        {
            $source_file = $this->locateSource($source);

            if(!$cache_file = $this->isCached($source_file))
            {
                $source     = $this->loadSource($source_file);
                $source     = $this->compileSource($source);
                $cache_file = $this->cacheSource($source_file, $source);
            }
        }
        else
        {
            $name        = crc32($source);
            $source_file = '';

            if(!$cache_file = $this->isCached($name))
            {
                $source     = $this->compileSource($source);
                $cache_file = $this->cacheSource($name, $source);
            }
        }

        //Include the template
        $result = include $cache_file;

        //Render the debug information
        return  $this->renderDebug($result);
    }
94869
public function render($template, $data = null)
    {
        $this->templateName = $template;
        $this->templateFile = $this->getTemplatePathname($template);

        if (!is_file($this->templateFile))
        {
            throw new \RuntimeException("Slimore\\Mvc\\View cannot render `$template` because the template does not exist");
        }

        $this->setCompileDirectory();
        $this->setCompileFile($template);

        ob_start();

        $data = array_merge($this->data->all(), (array) $data);
        $data = array_merge(static::$globals, $data);

        static::getProperties([
            'data'               => $data,
            'compileCached'      => $this->compileCached,
            'templatePath'       => $this->getTemplatesDirectory() . DIRECTORY_SEPARATOR,
            'compilePath'        => $this->compilePath,
            'compileFileNameMd5' => $this->compileFileNameMd5,
            'compileFileSuffix'  => $this->compileFileSuffix
        ]);

        extract($data);

        //echo "this->compileCached =>" . ($this->compileCached ? 'true' : 'false');

        if (!$this->compileCached)
        {
            $tpl = $this->read($this->templateFile);
            $tpl = static::parser($tpl);
            $this->write($this->templateCompileFile, $tpl);
        }
        else
        {
            if (!file_exists($this->templateCompileFile) ||
                (filemtime($this->templateFile) > filemtime($this->templateCompileFile))
            ) {
                $tpl = $this->read($this->templateFile);
                $tpl = static::parser($tpl);
                $this->write($this->templateCompileFile, $tpl);
            }
        }

        require $this->templateCompileFile;

        echo ob_get_clean();
    }
1328638
public function render($template, $data = [], $code = 200, array $headers = [])
    {
        $this->code = $code;

        $this->withHeaders($headers);

        $view = View::parse($template, $data);

        $this->content = $view->sendContent();

        return $this->buildHttpResponse();
    }
168647
public function render($template, array $data = [])
    {
        if (is_null($this->loader)) {
            return $this->renderString($template, $data);
        }

        if (! $this->loader->exists($template)) {
            $this->loader->failLoading($template .' not found');
        }

        $this->pushSharedData($data);

        $__tintin = $this;

        extract($this->getSharedData());

        /**
         * Load template when is not a cached file
         */
        if (! $this->loader->isExpirated($template)) {
            $this->obFlushAndStar();

            require $this->loader->getCacheFileResolvedPath($template);
            
            return $this->obGetContent();
        }

        /**
         * Put the template into cache
         */
        $content = $this->loader->getFileContent($template);

        $this->loader->cache(
            $template,
            $this->compiler->compile($content)
        );

        $this->obFlushAndStar();

        require $this->loader->getCacheFileResolvedPath($template);

        return $this->obGetContent();
    }
136374
public function fetch($template, $data = NULL )
    {

        $app = App::getInstance();

        if (empty($template)) {
            return $this->data['body'];
        } else {
            if ($app->theme) {
                $template = $app->theme->resolve($template, $this) ?: $template;
            }

            $html = parent::fetch($template);

            $layoutTemplate = null;
            if ($this->layout) {
                if ($app->theme) {
                    $layoutTemplate = $app->theme->resolve($this->layout, $this->layoutView);
                } else {
                    $layoutTemplate = $this->layout;
                }
            }

            if ($layoutTemplate) {
                $this->layoutView->replace($this->all());
                $this->layoutView->set('body', $html);

                return $this->layoutView->render($layoutTemplate);
            } else {
                return $html;
            }
        }
    }