Render the default template file.
@param  string $template template file
@param  array  $params   parameters
@return string
420372
protected function renderDefaultTemplate($template, $params=[]) {
		if(!file_exists($template)) {
			$template = $this->solveTemplatePath($orig = $template);
			if(!file_exists($template))
				throw new \Exception('The template file "'.$orig.'" could not be found.');
		}

		extract($params);

		ob_start();
		include($template);
		return ob_get_clean();
	}
676661
protected function render(array $options, array $templateParams = [])
    {
        $template = isset($options['template']) ? $options['template'] : $this->getDefaultTemplate();

        return $this->templating->render($template, array_merge($options, $templateParams));
    }
1228307
public function getTemplateFile($template)
	{
	    if (!is_file($template)) {
	        $template = $this->getTemplatePath() . $this->_getRelativeTemplate($template) . $this->getSuffix();
	    }
	    
	    return $template;
	}
223233
public function renderPhpTemplate($template, array $data)
    {
        extract($data, EXTR_SKIP);

        unset($data); // Kill duplicates

        ob_start();
        include $template;
        return ob_get_clean();
    }
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);
        }
    }
169811
public function addTemplateTo($zone, $template, Array $params=array()){
		if(!isset($this->content[$zone]))
			$this->content[$zone] = array();
		$this->content[$zone][] = array('type'=>'template', 'template'=>$template, 'params'=>$params);
	}
988681
public function render($template,$data=[]){
		$loader = new \Twig_Loader_Filesystem($this->environment->getRootPath().'/template');
		$twig = new \Twig_Environment($loader);

		$extensionDir=$this->environment->getSrcPath().'/Twig/Extension';
		if(file_exists($extensionDir)){
			$hDir=opendir($extensionDir);
			while($file=readdir($hDir)){
				if($file=='.' || $file=='..'){
					continue;
				}
				$objName='\Twig\Extension\\'.pathinfo($file, PATHINFO_FILENAME);
				$twig->addExtension(new $objName($data));
			}

			closedir($hDir);			
		}

		return $twig->render($template, $data);
	}
435022
public function render($template, array $parameters = [])
    {
        $resource = $this->loadTemplate($template);

        $this->stack->push([
            $resource,
            $this->mergeShared($this->getParameters($template, $parameters))
        ]);

        $hash = $resource->getHash();

        if (isset($this->parents[$hash])) {
            throw new RenderException(sprintf('Circular reference in %s.', $template));
        }

        unset($this->parents[$hash]);

        $this->startErrorHandling();

        $content = $this->doRender();

        if (isset($this->parents[$hash])) {
            $content = $this->render($this->parents[$hash], $parameters);
        }

        $this->stopErrorHandling();

        $this->stack->pop();

        return $content;
    }
789179
public function render($options = array())
    {
        $template = $options['template'];
        $data = $options['data'];

        if (file_exists(($file = $this->templatePath.DIRECTORY_SEPARATOR.$template.'.tpl.php'))) {
            $template = file_get_contents($file);
        }
        else {
            Console::writeInfo('template '.$file.' was not found...');
        }

        return $this->renderTpl($template, $data);
    }
868991
protected function render($template, $parameters)
    {
        $twig = new \Twig_Environment(
            new \Twig_Loader_Filesystem($this->getSkeletonDir()),
            array(
                'debug' => true,
                'cache' => false,
                'strict_variables' => true,
                'autoescape' => false,
            )
        );
        $twig->addExtension(new VinceTBaseExtension());

        return $twig->render($template, $parameters);
    }
390886
protected function runTemplate($method, array $params=[]) {
		ob_start();
		$result         = call_user_func_array([$this, $method], $params);
		$viewableBuffer = ob_get_clean();

		#result returned by method?
		if($result !== null) {
			if($result instanceof TemplateInterface) {
				if(!$result->getEngine() && $this->templateEngine)
					$result->setEngine($this->templateEngine);
				return $result->render();
			}
			elseif(is_numeric($result))
				return (string)$result;
			else
				return $result;
		}
		#output from method?
		elseif($viewableBuffer)
			return $viewableBuffer;
		#given view?
		elseif($this->view) {
			#given template engine?
			if($this->templateEngine)
				return $this->templateEngine->createTemplate()->render($this->view, (array)$this);
			#use the default render technique
			else
				return $this->renderDefaultTemplate($this->view, (array)$this);
		}
		#default view
		elseif($this->defaultView) {
			#given template engine?
			if($this->templateEngine) {
				$engine = $this->templateEngine;
				if($engine->templateExists($this->defaultView))
					return $engine->createTemplate()->render($this->defaultView, (array)$this);
			}
			#use the default render technique
			elseif($this->templateExists($this->defaultView))
				return $this->renderDefaultTemplate($this->defaultView, (array)$this);
		}
		#nothing to return
		return null;
	}
1258549
function renderTemplate(fragment, templateName) {
    if (templateName === 'none') return fragment._txt;
    var t = generator.template$[templateName];
    if (!t) {
      log('Unknown template %s for %s, using default.', templateName, fragment._href);
      t = generator.template$.default;
    }

    var out;
    try { out = t(fragment); }
    catch(err) {
      var msg = u.format('Error rendering %s\n\ntemplate: %s\n',
                         fragment._href, templateName, err.stack || err);
      log(msg);
      out = opts.production ? '' : '<pre>' + esc(msg) + '</pre>';
    }

    return out;
  }
124324
public function findTemplate($template)
    {
        $file = $this->basePath("app/Template/$template");
        if($this->findFile($file)) {
            return $file;
        }
        elseif($this->findFile($file.'.html')) {
            return $file.'.html';
        }
        elseif($this->findFile($file.'.php')) {
            return $file.'.php';
        }
        else {
            throw new Exception($file." Template file is missing.");
            exit;
        }
    }
261817
public function render(string $template, array $data = [])
    {
        try {
            return $this->load($template)->render($data);
        } catch (SyntaxError $e) {
            if ($this->exceptionHandler) {
                $templatePath = $this->finder->find($template);

                $e->setTemplateFile($templatePath);
                $e->setTemplateContent($this->finder->getContents($templatePath));

                return $this->renderSyntaxError($e);
            } else {
                throw $e;
            }
        }
    }
899961
protected function renderTemplate($template)
    {
        // Build allowed extensions
        $allowedExtensions = new ArrayList();
        foreach (File::getAllowedExtensions() as $extension) {
            if ($extension) {
                $allowedExtensions->push(new ArrayData([
                    'Extension' => preg_quote($extension)
                ]));
            }
        }

        Config::nest();
        Config::modify()->set(SSViewer::class, 'source_file_comments', false);

        $viewer = SSViewer::create([$template]);
        $result = (string)$viewer->process(new ArrayData([
            'AllowedExtensions' => $allowedExtensions
        ]));

        Config::unnest();

        return $result;
    }
348712
public function renderTemplate($template, $vars)
    {
        $twig = $this->getContainer()->get('twig');

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

        return $template->render($vars);
    }
543129
protected function renderFile($template, $target, $parameters)
    {
        $this->fs->dumpFile(
            $target,
            $this->render($template, $parameters)
        );
    }