Render a template

@param   array   $data   The data to pass to the template
@throws  RuntimeException If the template could not be evaluated
@return string The rendered template source
553714
public function render(array $data = array())
    {
        parent::render();

        if(!$this->_twig_template instanceof Twig_Template) {
            throw new RuntimeException(sprintf('The template cannot be rendered'));
        }

        //Render the template
        $content = $this->_twig_template->render($data);

        //Remove the template from the stack
        array_pop($this->_stack);

        return $content;
    }
370090
protected function _renderContent($data)
    {
        $options = $data['options'];

        if ($options instanceof Traversable) {
            $options = iterator_to_array($options);
        }

        if (!empty($data['empty'])) {
            $options = $this->_emptyValue($data['empty']) + (array)$options;
        }
        if (empty($options)) {
            return [];
        }

        $selected = isset($data['val']) ? $data['val'] : null;
        $disabled = null;
        if (isset($data['disabled']) && is_array($data['disabled'])) {
            $disabled = $data['disabled'];
        }
        $templateVars = $data['templateVars'];

        return $this->_renderOptions($options, $disabled, $selected, $templateVars, $data['escape']);
    }
1346878
public function render(array $data = array())
    {
        parent::render($data);

        if($this->_source instanceof KTemplateEngineInterface)
        {
            $this->_source = $this->_source->render($data);
            $this->_source = $this->filter();
        }

        return $this->_source;
    }
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();
    }
1027896
protected function renderHtml($data)
    {
        $html = $this->getHtmlPrefix();
        $html .= $this->arrayToHtml($data);
        $html .= $this->getHtmlPostfix();

        return $html;
    }
749360
public function render(string $template = "", array $data = []): string
    {
        try {
            if ($template) {
                $filename = dirname(__DIR__, 4)
                          . DIRECTORY_SEPARATOR
                          .  "layout"
                          . DIRECTORY_SEPARATOR
                          . str_replace("..", "", $template);
                if (!is_file($filename)) {
                    throw new Exception ($filename . " is not a file");
                }
                $this->__construct();
                extract($data);
                ob_start();
                include $filename;
                $this->obContents = ob_get_contents();
                ob_end_clean();
            }
            return $this->obContents ? $this->obContents : parent::render();
        } catch (Throwable $e) {
            throw new ViewException(
                "Can't render " . static::class . " " . $e->getMessage()
            );
        }
    }
440104
public function render($name, $data = null)
  {
    $t = $this->template($name, $data);

    return $t->render();
  }
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);
    }
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();
    }
701316
protected function render($templates, array $data = array())
    {
        $content = $this->view->render($templates, $data);
        $response = new Response();
        $response->setContent($content);

        return $response;
    }
546238
public function found(array $data): Response
    {
        $view = $data['view'] ?? '';
        $templateVars = $data['vars'] ?? [];
        $this->response->setBody(
            $this->renderer->render($view, $templateVars)
        );
        return $this->response;
    }
382846
public function render(array $data = []): string
    {
        $this->addData($data);
        unset($data);
        \extract($this->data, EXTR_OVERWRITE);

        $__level__ = \ob_get_level();

        try {
            \ob_start();
            include $this->template;
            $content = \ob_get_clean();

            if (null !== $this->layoutName) {
                $layout = $this->engine->make($this->layoutName);
                $layout->sections = \array_merge($this->sections, ['content' => $content]);
                $content = $layout->render($this->layoutData);
            }

            return $content;
        } catch (\Throwable $e) {
            while (\ob_get_level() > $__level__) {
                \ob_end_clean();
            }

            throw $e;
        }
    }
1220943
public function render($template, $data){
		$rtn = $this->twig->render($template, $data);
		return $rtn;
	}
624576
public function renderView($template, $data = [])
    {
        $template = $this->di->get("views")->getTemplateFile($template);
        $view = $this->di->get("view");
        $view->setDI($this->di);
        $view->set($template, $data);
        $view->render();
    }
742349
@Override
    public void render(ElementTemplate eleTemplate, Object data, XWPFTemplate template) {
        RunTemplate runTemplate = (RunTemplate) eleTemplate;
        // validate
        if (!validate(data)) {
            clearPlaceholder(runTemplate.getRun());
            return;
        }

        // do render
        try {
            doRender(runTemplate, data, template);
        } catch (Exception e) {
            doRenderException(runTemplate, data, e);
        }

    }
107545
public function render(array $data = [])
	{
		// run the methods
		$this->before();

		if (method_exists($this, $this->method))
		{
			$this->{$this->method}();
		}

		$this->after();

		// transfer the presenter data to the view
		$this->view->merge($this);

		// set autofilter on view
		$this->view->autoFilter($this->autoFilter);

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

        return json_encode($this->_data);
    }