Devulve una vista compatible con los clientes de correo

@param $template
@param array $data
@param array $css
@return string
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);
    }
1367006
public function render($template = '', $data = []) {
		if (!isset($this->blocks[$template])) {
			$this->blocks[$template] = $this->blockFactory->create($template);
		}
		$block = $this->blocks[$template];
		$block->setData($data);
		return $block->render();
	}
821662
public function renderTemplate($templatePath = null, $data = [])
    {
        $renderedTemplate = $this->view->renderTemplate($templatePath, $data);
        return $renderedTemplate;
    }
933682
protected function templateToString($template, array $data)
    {

        $templateFullName = $this->getTemplateFullName($template);

        if (!is_file($templateFullName)) {
            throw new RuntimeException("View cannot render `$template` because the template does not exist");
        }

        $fullData = array_merge($this->attributes, $data);
        $this->levelStartObcache = ob_get_level();
        $this->startSection($this->courentSection);
        $this->protectedIncludeScope($templateFullName, $fullData);
        $output = $this->endSection(true);
        $this->sectionContent[self::CONTENT] = $this->sectionContent[self::C_CONTENT];
        unset($this->sectionContent[self::C_CONTENT]);
        while (ob_get_level() > $this->levelStartObcache) {
            ob_end_clean();
        }

        if (!empty($this->layout)) {
            $layout = $this->layout;
            $this->layout = '';
            return $this->templateToString($layout, $fullData);
        }

        return $output;
    }
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;
    }
284283
public static function render($template = '', $data = [])
    {
        $templatesPath = realpath(__DIR__ . '/../templates');
        $loader        = new \Twig_Loader_Filesystem($templatesPath);
        /** @var object $twig */
        $twig         = new \Twig_Environment($loader);
        $templateFile = $template . '.html';

        return $twig->render($templateFile, $data);
    }
258286
private function setMoreLinkData(FrontendTemplate $template, array $data)
    {
        $template->more = null;

        if ($data['cookiebar_url']) {
            $template->more = [
                'label' => $data['cookiebar_link'] ?: $GLOBALS['TL_LANG']['MSC']['cookiebar.more'],
                'url' => $data['cookiebar_url'],
            ];
        }
    }
1220943
public function render($template, $data){
		$rtn = $this->twig->render($template, $data);
		return $rtn;
	}
273709
public function render($template, $data = [], array $options = []) {
		$defaults = ['context' => []];
		$options += $defaults;

		$this->_context = $options['context'] + $this->_context;
		$this->_data = (array) $data + $this->_vars;
		$this->_options = $options;
		$template__ = $template;
		unset($options, $template, $defaults, $data);

		if ($this->_config['extract']) {
			extract($this->_data, EXTR_OVERWRITE);
		} elseif ($this->_view) {
			extract((array) $this->_view->outputFilters, EXTR_OVERWRITE);
		}

		ob_start();
		include $template__;
		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();
    }
182101
public function buildTemplate($template, array $vars = [])
    {
        // Заменяем переменные в шаблоне
        //$found_template[$key] = preg_replace(array_keys($vars_preg_replace), array_values($vars_preg_replace), $value);

        try {
            //$tmp = $this->getContainer()->get('twig')->createTemplate('{% spaceless %} ' . $template . ' {% endspaceless %}');
            //                     'cache' => new \Twig_Cache_Filesystem($this->getConnector()->getTempDir(), \Twig_Cache_Filesystem::FORCE_BYTECODE_INVALIDATION),
            $tmp = $this->getContainer()->get('twig')->createTemplate('{% spaceless %} ' . $template . ' {% endspaceless %}');

            if ($vars) {
                $result = $tmp->render($vars);
            } else {
                $result = $tmp->render($this->vars);
            }

            /*
            $loader = new \Twig_Loader_Array(array(
                'index.html' => '{% spaceless %}' . $template . '{% endspaceless %}',
            ));

            $twig = new \Twig_Environment($loader, array(
                'autoescape' => false,
                'debug' => false
            ));

            $result = $twig->render('index.html', $this->vars);
            */
        } catch (\Exception $e) {
            $result = '';
        }

        $result = str_replace([' x ', ' х ', '()', ' ,', ' .', '( )'], [' ', ' ', '', ',', '.', ''], $result);

        // Вырезаем незамененые переменные
        //$result = trim(preg_replace('/\{\{.*\}\}/im', ' ', $result));

        $result = trim($result, ',:');

        // Удалить два и более пробела
        $result = trim(preg_replace('/ {2,}/m', ' ', $result));

        return $result;
    }
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);
        }
    }
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;
        
    }
78954
public static function from($template,$data=null){
      $view = new self($template);
      return $data ? $view->with($data) : $view;
    }
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);
    }
1124135
public function loadTemplate($template, $data = array(), $process = true)
    {
        $path = $this->findTemplate($template);

        if (! $path) {
            unset($this->_paths[$template.'.php']);
            throw new LibBaseTemplateException($template.' template not found for '.$this->getIdentifier());
            return false;
        }

        return $this->loadFile($path, $data, $process);
    }
18643
final public function render($template=null, $data=null)
    {
        $renderType = $this->getRenderType();
        switch ($renderType) {
            case 'json':
                $this->renderJson($data);
                break;
            case 'xml':
                $this->renderXml($data);
                break;
            case 'html':
                $this->renderHtml($template, $data);
                break;
            default:
                $string = print_r($data, true);
                $this->renderText($string);
                break;
        }
        
        return $this->response;
    }