Searches a renderer for the given template file and renders the
file.

@access protected
@param string $templateFile
@param array $additionalData
@return string
504499
protected function searchRendererAndRenderTemplate($templateFile, $additionalData = array())
    {
        // Get the file information for the template file
        $fileInfo = pathinfo($templateFile);
        $extension = $fileInfo['extension'];
        
        // If we haven't a renderer for this extension we return an
        // empty string to prevent everything from failing.
        if (!isset($this->renderer[$extension])) {
            return '';
        }
        
        // Take the renderer...
        $renderer = $this->renderer[$extension];
        
        // ...and render the template file.
        return $renderer->renderTemplateFile(
            $templateFile, 
            $this->framework, 
            $this->framework->getRequest(), 
            $this->framework->getResponse(),
            $additionalData
        );
    }
858336
public function render(string $template, array $data = []) : string
    {
        try {
            return $this->renderer->render($template, $data);
        } catch (Twig_Error_Loader $e) {
            throw new TemplateNotFoundException("Template '$template' not found by Twig renderer",
                null, $e);
        }
    }
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();
    }
221803
public function render($templateName = null, $data = [])
    {
        $this->setTemplate($templateName, $data);

        if (empty($this->_templateName)) {
            if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                $this->getLogger()->debug('template name is null');
            }

            throw new \RuntimeException('TEMPLATE_IS_NULL');
        }
        $buffer = $this->_parseTemplate($this->_templateName, $this->_data);
        if (!empty($this->_layout)) {
            if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                $this->getLogger()->debug('loading layout: '.$this->_layout);
            }

            $buffer = $this->_parseTemplate(
                $this->_layout,
                array_merge($this->_data, ['__body__' => $buffer])
            );
        }

        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));
    }
918322
private function render($templateString, array $data)
    {
        $snippetRenderer = \TPkgSnippetRenderer::GetNewInstance(
            $templateString,
            \IPkgSnippetRenderer::SOURCE_TYPE_STRING
        );
        foreach ($data as $key => $value) {
            $snippetRenderer->setVar($key, $value);
        }

        return trim($snippetRenderer->render());
    }
1095613
public function render($path, $templateName, array $datas)
    {
        $viewRenderer = clone $this->viewRenderer;
        foreach ($datas as $name => $data) {
            $viewRenderer->$name = $data;
        }

        return $viewRenderer->render($path, $templateName);
    }
1233288
public function render(string $template, array $data = []): string
    {
        // we store the current state of the template variables
        // so that we have isolated cases on multiple calls to render()
        $backupVariables = $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables;

        if (!empty($data)) {
            $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables = $data;
        }

        try {
            ob_start();

            /** @noinspection PhpIncludeInspection */
            require $template;
        } finally {
            $output = ob_get_clean();
        }

        $this->thisShouldMakeItUniqueCodeCollabTemplateHtmlVariables = $backupVariables;

        return $output;
    }
223233
public function renderPhpTemplate($template, array $data)
    {
        extract($data, EXTR_SKIP);

        unset($data); // Kill duplicates

        ob_start();
        include $template;
        return ob_get_clean();
    }
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();
    }
221049
public function render($__layout, $__data = [], $__more = [])
    {
        // TODO: Aliases

        $this->incrementRender();

        $__path = $this->loader->find($__layout);

        if ($this->cache->isExpired($__path)) {
            $compiler = $this->prepareExtensions(clone $this->compiler);

            $this->cache->store($__path, $compiler->compile($this->loader->load($__path)));

            unset($compiler);
        }

        $__data = array_merge($this->getGlobals(true), $__more, $__data);

        foreach ($__data as $__key => $__value) {
            if ($__key === '__path' || $__key === '__data') {
                continue;
            }

            $$__key = $__value;
        }

        unset($__data, $__value, $__key);

        ob_start();

        try {
            if ($this->cache instanceof EdgeFileCache) {
                include $this->cache->getCacheFile($this->cache->getCacheKey($__path));
            } else {
                eval(' ?>' . $this->cache->load($__path) . '<?php ');
            }
        } catch (\Throwable $e) {
            ob_clean();
            $this->wrapException($e, $__path, $__layout);

            return null;
        }

        $result = ltrim(ob_get_clean());

        $this->decrementRender();

        $this->flushSectionsIfDoneRendering();

        return $result;
    }
752311
public function render($template, array $data = [])
    {
        $isString = is_string($template);

        if ($isString && is_file($template)) {
            return $this->renderTemplate($template, $data);
        }
        if (! $isString && ! is_array($template)) {
            throw new InvalidArgumentException('Template must be a string or an array of strings.');
        }
        $path = $this->find($template);
        if ($path) {
            return $this->doRender($path, $data);
        }
        if ($isString) {
            throw new RuntimeException($template.' is not a valid template name.');
        }

        throw new RuntimeException('Not found any valid template in the array provided.');
    }
372557
public function render($templatePath)
    {
        if(!is_file($templatePath) || !is_readable($templatePath))
        {
            throw new FileNotFoundException(sprintf('Template file "%s" does not exists.',
                                                    $templatePath));
        }
        if (!is_readable($templatePath))
        {
            throw new FileNotReadableException(sprintf('Template file "%s" is not readable.',
                                                       $templatePath));
        }
        try
        {
            extract($this->getTemplateVars());
            ob_start();
            /** @noinspection PhpIncludeInspection */
            require $templatePath;
            $contents = ob_get_clean();
        }
        catch(\Exception $e)
        {
            ob_clean();
            throw new TemplateException(sprintf('Error rendering template. %s', $e->getMessage()));
        }

        return $contents;
    }
821662
public function renderTemplate($templatePath = null, $data = [])
    {
        $renderedTemplate = $this->view->renderTemplate($templatePath, $data);
        return $renderedTemplate;
    }
21890
public static function renderThemeTemplate($target, $templateId, $data = array()){

        //search in the registry to get the custom template to render
        $tpl = self::getThemeTemplate($target, $templateId);
        $theme = self::getCurrentTheme();

        if(!is_null($tpl)){
            if ($theme instanceof ConfigurablePlatformTheme) {
                // allow to use the getters from ConfigurablePlatformTheme
                // to insert logo and such
                $data['themeObj'] = $theme;
            }
            //render the template
            $renderer = new \Renderer($tpl, $data);
            return $renderer->render();
        }
        return '';
    }
1160281
public String render(Template template, GlobalScope... extraGlobalScopes) throws IOException {  
    StringWriter out = new StringWriter();
    render(template, out, extraGlobalScopes);
    return out.toString();
  }
1049190
public function render(){
        
        $rendered_image = '';
        
        if( file_exists( $this->script_path ) ) 
        {
            ob_start();
            include( $this->script_path );
            $rendered_image = ob_get_clean();
        } 
        else throw new TemplateNotFoundException("The following file could not be found: " . $this->script_path);
        
        return $rendered_image;
    }