Compile blade template to HTML.

@param  string $template
@param  array $data

@throws \Exception
@return string
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;
    }
1218424
public function render($template, array $locals = [])
    {
        $templatePath = $this->find($template);

        if (!$templatePath) {
            throw new Exception("Unable to find template [$template]");
        }

        // View variables
        $variables = $locals + $this->globals;
        foreach ($variables as $_name => $_value) {
            $$_name = $_value;
        }

        // Shortcut for escaping HTML
        $e = function($string) {
            return htmlspecialchars($string);
        };

        // Shortcut for Language::translate()
        $t = function($string, array $vars = array()) {
            return Language::translate($string, $vars);
        };

        // Shortcut for Language::date()
        $l = function($format, $timestamp = null) {
            return Language::date($format, $timestamp);
        };

        ob_start();
        include($templatePath);
        return ob_get_clean();
    }
1156180
public function render(\Laasti\Views\Template $template)
    {
        $filepath = $this->findTemplateFile($template->getView());
        if ($template->getData() instanceof \Laasti\Views\Data\DataInterface) {
            $data = $template->getData()->toArray();
        } else {
            $data = $template->getData();
        }
        foreach ($data as $key => $value) {
            ${$key} = $value;
        }
        ob_start();
        include $filepath;
        $content = ob_get_contents();
        @ob_end_clean();
        return $content;
    }
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;
    }
1021437
public function render($template, array $viewData = [])
    {
        $filePath = $this->finder->getTemplatePath($template);
        if ($filePath == false) {
            throw new InvalidArgumentException("Can't load template '$template'");
        }
        ob_start();
        extract($viewData);
        include($filePath);
        $contents = ob_get_contents();
        ob_end_clean();
        return $contents;
    }
588584
public function render($view, array $data = [])
    {
        // Get Body-Template
        $template = $this->getTemplate($view);

        // extend with default data
        $data += $this->data;

        // set tags
        foreach ($data as $name => $value) {
            $template->tag($name, $value);
        }

        // Render Page
        return $this->applyFunctions(get_maintemplate((string)$template));
    }
1269576
protected function render($template, $data = array()) {
        Router::getInstance()->render($template, $data);
        $response = ob_get_contents();
        return ob_get_clean();
    }
1154565
protected function replace(array $data, $template, $prefix = null)
    {
        foreach ($data as $k => $d) {
            if (is_array($d)) {
                return $this->replace($d, $template, $k . '.');
            } else {
                $template = str_replace('{' . (!empty($prefix) ? $prefix . $k : $k) . '}', $d, $template);
            }
        }

        return $template;
    }
802713
public function render($template, array $data = [])
    {
        ob_start();
        $this->requireTemplate($template, $data);

        while ($extend = array_pop($this->inherits)) {
            ob_clean();
            $this->requireTemplate($extend, $data);
        }

        return ob_get_clean();
    }
1038144
public function fetch($template, $data = [])
    {
        $data = array_merge($this->defaultVariables, $data);

        $this->smarty->assign($data);

        return $this->smarty->fetch($template);
    }
933682
protected function templateToString($template, array $data)
    {

        $templateFullName = $this->getTemplateFullName($template);

        if (!is_file($templateFullName)) {
            throw new RuntimeException("View cannot render `$template` because the template does not exist");
        }

        $fullData = array_merge($this->attributes, $data);
        $this->levelStartObcache = ob_get_level();
        $this->startSection($this->courentSection);
        $this->protectedIncludeScope($templateFullName, $fullData);
        $output = $this->endSection(true);
        $this->sectionContent[self::CONTENT] = $this->sectionContent[self::C_CONTENT];
        unset($this->sectionContent[self::C_CONTENT]);
        while (ob_get_level() > $this->levelStartObcache) {
            ob_end_clean();
        }

        if (!empty($this->layout)) {
            $layout = $this->layout;
            $this->layout = '';
            return $this->templateToString($layout, $fullData);
        }

        return $output;
    }
1303268
public function render($view, $data = [])
    {
        $this->writeFile($view);
        $blade = new Blade($this->getViewPath(), $this->getCachePath());

        if (is_array($data)) {
            return $blade->view()->make($view, $data)->render();
        } else {
            throw new Exception('data pass into view must be an array.');
        }
    }
837424
protected static function evalTemplateConditionals($template, array $data, array $conditionals = null)
    {
        // find all conditionals
        if(!isset($conditionals))
            $conditionals = self::getTemplateConditionals($template);

        if(empty($conditionals))
            return $template;

        // check them all
        foreach($conditionals['set'] as $conditional)
        {
            if(isset($data[$conditional]))
                $template = str_replace(['{{ifdef '. $conditional . '}}', '{{endif ' . $conditional . '}}'], '', $template);
            else
                $template = preg_replace('#\{\{ifdef ' . $conditional . '\}\}[\s\S]*\{\{endif ' . $conditional . '\}\}#', '', $template);
        }

        foreach($conditionals['not_set'] as $conditional)
        {
            if(!isset($data[$conditional]))
                $template = str_replace(['{{ifndef '. $conditional . '}}', '{{endif ' . $conditional . '}}'], '', $template);
            else
                $template = preg_replace('#\{\{ifndef ' . $conditional . '\}\}[\s\S]*\{\{endif ' . $conditional . '\}\}#', '', $template);
        }

        return $template;
    }
406505
public function render($view, array $data = null)
	{
		$engine = new Engine($this->templatePath);
		$template = new Template($engine);
		return $template->render($view, $data);
	}
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);
    }
667356
protected function render($template, $data = [])
    {
        $view = new View();
        $view->type(View::VIEW_TYPE_CELL);
        $view->set($data);
        $className = get_class($this);
        $namePrefix = '\View\Cell\\';
        $name = substr($className, strpos($className, $namePrefix) + strlen($namePrefix));
        $view->context(str_replace('\\', DIRECTORY_SEPARATOR, $name));
        return $view->render($template);
    }
18643
final public function render($template=null, $data=null)
    {
        $renderType = $this->getRenderType();
        switch ($renderType) {
            case 'json':
                $this->renderJson($data);
                break;
            case 'xml':
                $this->renderXml($data);
                break;
            case 'html':
                $this->renderHtml($template, $data);
                break;
            default:
                $string = print_r($data, true);
                $this->renderText($string);
                break;
        }
        
        return $this->response;
    }