@param string $template
@param array  $data

@throws SyntaxError

@return string
356909
public function renderString(string $template, array $data = [])
    {
        try {
            return $this->loadFromString($template)->render($data);
        } catch (SyntaxError $e) {
            if ($this->exceptionHandler) {
                $e->setTemplateContent($template);

                return $this->renderSyntaxError($e);
            } else {
                throw $e;
            }
        }
    }
156781
public function renderString($template, array $data = [])
    {
        return $this->executePlainRendering(
            trim($this->compiler->compile($template)),
            array_merge($data, ['__tintin' => $this])
        );
    }
1269576
protected function render($template, $data = array()) {
        Router::getInstance()->render($template, $data);
        $response = ob_get_contents();
        return ob_get_clean();
    }
542647
public static function render($template, $data = [])
    {
        // @var \Illuminate\View\Factory $factory
        $factory = self::instance()->view();

        // @var \Illuminate\Contracts\View\View $view
        $view = $factory->make($template, $data);

        return $view->render();
    }
631885
public function render($templateName = null, $data = [])
    {
        $this->setTemplate($templateName, $data);

        return json_encode($this->_data);
    }
952132
protected function _include($template, $data = NULL)
    {
        // Merge local data with global data
        $data = isset($data) ? array_merge($this->_data, $data) : $this->_data;
        // Compile and run template
        $compiled = $this->_compile($template);

        return $this->_run($compiled, $data);
    }
700130
public function template($template, $data = array(), $options = '')
    {
        $this->template = array($template, $data, $options);
        $template = new Template(Base::getInstance());
        $this->loaderHooks($template,'pre_template',$class='',$method_name='',$data=array());
        return $template;
    }
273008
public function render(string $templatePrefix, array $data): string
    {
        $formLayout = $this->layoutManager->getDefaultLayout();

        if ($formLayout instanceof HorizontalFormLayout) {
            $templateName = $templatePrefix . '_horizontal';
        } else {
            $templateName = $templatePrefix . '_default';
        }

        $template = new FrontendTemplate($templateName);
        $template->setData($data);
        $this->prepare($template);

        return $template->parse();
    }
1220429
protected function render(array $data = [], $template = null)
    {
        if (!$template) {
            $template = $this->template;
        }

        $template = (!empty($template)) ? $template : $this->router->directory . $this->router->class . '/' . $this->router->method;
        $data = array_merge($this->data, $data);
        if ($this->input->is_ajax_request()) {
            $this->layout = false;
        } else {
            if (!isset($data['page_title'])) {
                $data['page_title'] = 'lang:' . $this->router->class . '_title_' . $this->router->method;
            }
        }
        $view = new View($this->layout);
        $view->set($data);
        $this->output->set_output($view->render($template));

        if ($this->layout && ($csp = config_item('csp_protection'))) {
            // Add CSP
            if (!isset($csp['script-src'])) {
                $csp['script-src'] = ['self'];
            }
            $asset = Asset::getInstance();
            foreach ($asset->getScriptNonces() as $nonce) {
                $csp['script-src'][] = "'nonce-".$nonce."'";
            }
            $string = '';
            foreach ($csp as $key => $values) {
                $string .= " " . $key . " " . implode(" ", $values) .";";
            }
            if ($report = config_item('csp_report')) {
                $string .= " report-uri " . $report;
            }
            if (config_item('csp_report_only')) {
                $this->output->set_header('Content-Security-Policy-Report-Only:'. $string);
                //var_dump($csp);die;
            } else {
                $this->output->set_header('Content-Security-Policy:'. $string);
            }
        }
    }
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);
        }
    }
820526
public function partial($template, array $data = array())
    {
        $app = App::getInstance();
        $Clazz = $app->config('bono.partial.view');

        $view = new $Clazz();
        $t = $this->resolve($template, $view);

        if (empty($t)) {
            throw new \Exception('Cant resolve template "'.$template.'"');
        }
        $view->replace($data);

        return $view->fetch($t);
    }
901996
public function display($template, $data = NULL)
    {
        $app = App::getInstance();
        $data = $this->data->all();
        unset($data['flash']);
        unset($data['app']);
        foreach (array_keys($data) as $key) {
            if ($key[0] === '_') {
                unset($data[$key]);
            }
        }

        $app->response->headers['content-type'] = $this->contentType;
        echo \JsonKit\JsonKit::encode($data);
    }
1220943
public function render($template, $data){
		$rtn = $this->twig->render($template, $data);
		return $rtn;
	}
400136
function compile (template, data) {
    for (var name in data) {
      template = template.replace('{{' + name + '}}', data[name])
    }
    return template
  }
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));
    }
1081385
protected function render($template, $data = array())
    {
        $view        = null;
        $data        = array_merge_recursive($this->all(), $data);
        $data['app'] = $this->app;
        $template    = $this->resolve($template);


        if (! $template) {
            return;
        }

        if (! $this->layout) {
            $view = $this->make($template, $data);
        } else {
            $view = $this->layout->nest('content', $template, $data);
        }

        return $view;
    }
1131757
protected function view(string $template, array $data = []) : string
    {
        if (!$this->mustacheInstance) {
            $viewsRoute = $this->config('paths.view');
            $options = ['extension' => '.hbs'];

            $this->mustacheInstance = new Mustache_Engine(array(
                'loader' => new Mustache_Loader_FilesystemLoader($viewsRoute, $options),
                'partials_loader' => new Mustache_Loader_FilesystemLoader($viewsRoute, $options),
                'charset' => 'UTF-8',
            ));
        }

        $tpl = $this->mustacheInstance->loadTemplate($template);
        $data = array_merge($this->getData(), $data);

        return $tpl->render($this->mapData($data));
    }