Render the mail template.

@param string $template  The mail template name
@param array  $variables The variables of template
@param string $type      The mail type defined in MailTypes::TYPE_*

@return MailRenderedInterface
777575
public function getMailRendered($template, array $variables = [], $type = MailTypes::TYPE_ALL)
    {
        $id = $this->getCacheId($template, $variables, $type);

        if (!isset($this->cache[$template][$id])) {
            $this->cache[$template][$id] = $this->getTemplater()->render($template, $variables, $type);
        }

        return $this->cache[$template][$id];
    }
811148
public function render($template, array $context = array())
    {
        $template = $this->twig->createTemplate($template);

        return $template->render($context);
    }
802713
public function render($template, array $data = [])
    {
        ob_start();
        $this->requireTemplate($template, $data);

        while ($extend = array_pop($this->inherits)) {
            ob_clean();
            $this->requireTemplate($extend, $data);
        }

        return ob_get_clean();
    }
729472
protected function render($template, $parameters)
    {
        $option = array(
            'debug' => true,
            'cache' => false,
            'strict_variables' => true,
            'autoescape' => false,
        );

        $self = $this;
        $twig = new \Twig_Environment(new \Twig_Loader_Filesystem($this->SBOskeletonDirs), $option);

        $twig->addFunction(new \Twig_SimpleFunction(
            'renderFile',
            function ($template, $target, $subParameters = []) use ($self,$parameters) {
                $self->renderFile($template, $target, array_merge($parameters, $subParameters));

                return '';
            },
            $option
        ));

        $twig->addFunction(new \Twig_SimpleFunction(
            'method_exists',
            function ($object, $methodeName) {
                return method_exists($object, $methodeName);
            },
            $option
        ));

        return $twig->render($template, $parameters);
    }
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);
    }
1270713
public function renderHtml($template=null, $data=null)
    {
        $this->beforeRender($data);
        
        $this->beforeRenderView();
        
        $template = !empty($template) ? $template : $this->getName();
        
        $string = $this->module->getView()->render($template, $this->responseData());
        
        return $this->renderText($string);
    }
1087174
protected function getCacheId($template, array $variables = [], $type = MailTypes::TYPE_ALL)
    {
        $serialize = serialize($variables);

        return sha1($template.'&&'.$serialize.'&&'.$type);
    }
1272830
public function render(string $view, array $templateVars = []): string
    {
        return $this->renderer->render($view, $templateVars);
    }
849396
public static function fromTemplate($template, array $variables)
    {
        if (strpos($template, '{') !== false) {
            $url = uri_template($template, $variables);
        } else {
            $url = $template;
        }

        return self::fromString($url);
    }
523578
public function render($template, $variables, $default = false)
    {
        if ($default) {
            $template = $this->homeService->defaultTemplate($template);
        }

        return new Response($this->templating->render($template, $variables));
    }
411537
protected function expandTemplate($template, array $variables = null)
    {
        $expansionVars = $this->getConfig()->toArray();
        if ($variables) {
            $expansionVars = $variables + $expansionVars;
        }

        return $this->getUriTemplate()->expand($template, $expansionVars);
    }
1255093
private function _renderTemplate($template = null)
    {
        // when no template, auto generate template path.
        // View/Content/[controller]/[action].html.twig
        $def = $this->actionChain->getCurrentAction();
        if (! $template) {
            $controller = join(DS, array_map('ucfirst', explode('_', $def['controller_name'])));
            $action = $def['action'];
            $template = sprintf('%s/%s.%s', $controller, substr($this->actionChain->actionNameStrategy($action), 0, -6), $this->renderer->getSuffix());
        }

        // rendering by renderer.
        $def['controller']->beforeRenderer();
        $result = $this->renderer->render($template);
        $this->response->setBody($result);
        if ($this->response->isHttp()) {
            $this->response->setHeader('content-type', sprintf('text/html; charset=%s', $this->application->config('encoding.output')));
        }
    }
742557
def render(template)
      template.render(config.variables.deep_merge(options[:globals]), strict_variables: true).tap do
        if template.errors&.length&.positive?
          puts template.errors
          raise template.errors.map(&:to_s).join('; ')
        end
      end
    end
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);
        }
    }
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.');
    }
1001852
public function renderTemplateString(string $template, array $variables = []): string
    {
        $output = $this->indexControlStructure($template, 'foreach');
        $output = $this->indexControlStructure($output, 'if', ['else']);

        $output = $this->resolveLoops($output, $variables);
        $output = $this->resolveConditionals($output, $variables);

        return $this->replaceVariablesInTemplate($output, $variables);
    }
927184
protected function render($template, $args = array())
    {
        if (!is_null($this->renderTemplateSuffix)
            && !preg_match('/\.' . $this->renderTemplateSuffix . '$/', $template)
        ) {
            $template .= '.' . $this->renderTemplateSuffix;
        }
        $this->app->render($template, $args);
    }