Use a template for the html content.
@param  string $template
@param  array  $data
@return string
559235
public function htmlTemplate($template, $data=[]) {
		$data['message'] = $this;
		$res = $this->buildTemplate($template, $data);
		return $this->html($res);
	}
661230
public function render($template, array $data = array(), $output = false)
    {
        foreach ($data as $k => $v) {
            $this->assign($k, $v);
        }
        ob_start();
        include $this->compiled($template);
        return $output ? ob_end_flush() : ob_get_clean();
    }
505656
public function renderSections($template, array $data = [], $class = null)
    {
        $outputs = new \stdClass();
        $setter = function ($name, $content) use ($outputs) {
            $outputs->$name = $content;
        };
        $this->events->on('f.sections.content', $setter);
        $this->render($template, $data, $class);
        $this->events->removeListener('f.sections.content', $setter);

        return get_object_vars($outputs);
    }
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);
    }
1254193
public function editor($template, $data = null, array $params = [])
    {
        $resource = 'templates/'.$template.'/editor';
        $params = array_merge([
            'key' => $this->key,
            'workspace' => $this->workspace,
            'signature' => $this->createSignature($resource)
        ], $params);

        if ($data)
        {
            $params['data'] = self::dataToString($data);
        }

        return $this->baseUrl.$resource.'?'.http_build_query($params);
    }
113149
public static function nativeRender($template = '', $data = [])
    {
        $templatesPath = realpath(__DIR__ . '/../templates');
        $templates     = new \League\Plates\Engine($templatesPath);

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

        return json_encode($this->_data);
    }
163730
public function mail($template, $data = array(), &$css = array())
    {
        $this->twig->addFunction(new \Twig_SimpleFunction('css', function ($file) use (&$css) {
            $css[] = $file;
        }));
        $template = $this->twig->loadTemplate($template);
        return $template->render($data);
    }
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;
    }
1118693
public function render($template, $data = [], array $options = []) {
		$defaults = ['context' => []];
		$options += $defaults;

		$context = [];
		$this->_context = $options['context'] + $this->_context;

		foreach (array_keys($this->_context) as $key) {
			$context[$key] = $this->__get($key);
		}
		$data = array_merge($this->_toString($context), $this->_toString($data));
		return Text::insert($template, $data, $options);
	}
1035998
public function compile($template, $data)
    {
        foreach ($data as $key => $value) {
            $key = strtoupper($key);

            if(is_bool($value))
                $value = $value ? 'true' : 'false';

            $template = preg_replace("#\\$$key\\$#i", $value, $template);
        }

        return $template;
    }
12406
public function render($template, $data = null)
    {
        $twig = $this->getTwig();
        $parser = $twig->loadTemplate($template);

        return $parser->render($this->all(), $data);
    }
745321
public function deserialize($data, Template $template)
    {
        $this->sipe('id', 'setUuid', $data, $template);
        $this->sipe('name', 'setName', $data, $template);
        $this->sipe('title', 'setTitle', $data, $template);
        $this->sipe('content', 'setContent', $data, $template);
        $this->sipe('lang', 'setLang', $data, $template);

        $templateType = isset($data['type']['id']) ?
            $this->templateTypeRepo->findOneBy(['uuid' => $data['type']['id']]) :
            null;

        if ($templateType) {
            $template->setType($templateType);
        }
        if (isset($data['localized'])) {
            foreach ($data['localized'] as $locale => $localizedData) {
                if (isset($localizedData['content'])) {
                    $localizedTemplate = isset($localizedData['id']) ?
                        $this->templateRepo->findOneBy(['uuid' => $localizedData['id']]) :
                        null;

                    if (!$localizedTemplate) {
                        $localizedTemplate = new Template();
                    }
                    $localizedTemplate->setLang($locale);
                    $localizedTemplate->setName($template->getName());
                    $localizedTemplate->setType($template->getType());
                    $localizedTemplate->setContent($localizedData['content']);

                    if (isset($localizedData['title'])) {
                        $localizedTemplate->setTitle($localizedData['title']);
                    }
                    $this->om->persist($localizedTemplate);
                }
            }
        }
        if (isset($data['defineAsDefault']) && $template->getType()) {
            $templateType = $template->getType();
            $templateType->setDefaultTemplate($template->getName());
            $this->om->persist($templateType);
        }

        return $template;
    }
837253
protected function responseTemplate($template, $data = array()){
        
        if(!isset(hubert()->template)){
            throw new \Exception("no template engine installed");
        }
        $html = hubert()->template->render($template, $data);
        $this->_response->getBody()->write($html);
        
        return $this->_response;
        
    }
327360
public function template($name, $data = null)
  {
    $t = $this->getTemplatesEngine()->make($name);

    if ($data) {
      $t->data($data);
    }

    return $t;
  }
1011709
private static function getTemplate(string $template, array $params): string
    {
        if (empty($template)) {
            return '';
        }
        $names   = array_keys($params);
        $replace = array_values($params);
        $search  = array_map(function ($v) {
            return sprintf('{%s}', $v);
        }, $names);

        return str_replace($search, $replace, $template);
    }
235688
public function render(string $template, array $data = []): string
	{
		$data = array_merge($this->data, $data);

		return $this->getRenderer()->make($template, $data)->render();
	}