@param Response $response
@param string   $template
@param array    $params

@return Response
764188
protected function render(Response $response, $template, array $params = [])
    {
        return $this->container['twig']->render($response, $template, $params);
    }
327610
public function sendTemplateAsync($templateId, $sendEmail)
    {
        return $this->sendTemplateAsyncWithHttpInfo($templateId, $sendEmail)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
381292
public static function _if($value, array $params, Template $template)
    {
        // is two operators (e.g. if ... then)
        if (empty($params) || count($params) < 2 || !isset($params['then'])) {
            throw new TemplateException(TemplateException::UNKNOWN_PARAM_FILTER, ['name' => __METHOD__]);
        }
        $params['else'] = isset($params['else']) ? $params['else'] : null;
        $template = clone $template;
        $placeholders = [];
        $placeholders['output'] = $value;

        // equals
        if ($condition = self::_getCondition($params, static::$conditionNames['is'])) {
            $result = $value == $template->replace($params[$condition])
                ? $template->replace($params['then'], $placeholders)
                : $template->replace($params['else'], $placeholders);
            // notequals
        } elseif ($condition = self::_getCondition($params, static::$conditionNames['isnot'])) {
            $result = $value <> $template->replace($params[$condition])
                ? $template->replace($params['then'], $placeholders)
                : $result = $template->replace($params['else'], $placeholders);
            // equals or greater
        } elseif ($condition = self::_getCondition($params, static::$conditionNames['gte'])) {
            $result = $value >= $template->replace($params[$condition])
                ? $template->replace($params['then'], $placeholders)
                : $template->replace($params['else'], $placeholders);
            // greater
        } elseif ($condition = self::_getCondition($params, static::$conditionNames['gt'])) {
            $result = $value > $template->replace($params[$condition])
                ? $template->replace($params['then'], $placeholders)
                : $template->replace($params['else'], $placeholders);
            // less or equals
        } elseif ($condition = self::_getCondition($params, static::$conditionNames['lte'])) {
            $result = $value <= $template->replace($params[$condition])
                ? $template->replace($params['then'], $placeholders)
                : $template->replace($params['else'], $placeholders);
            // less
        } elseif ($condition = self::_getCondition($params, static::$conditionNames['lt'])) {
            $result = $value < $template->replace($params[$condition])
                ? $template->replace($params['then'], $placeholders)
                : $template->replace($params['else'], $placeholders);
            // in array
        } elseif ($condition = self::_getCondition($params, static::$conditionNames['inarray'])) {
            $actual = trim($template->replace($params[$condition]));
            $actual = is_string($actual) ? explode(',', $actual) : $actual;
            $result = in_array($value, $actual)
                ? $template->replace($params['then'], $placeholders) : $template->replace(
                    $params['else'],
                    $placeholders);
        } else {
            throw new TemplateException(TemplateException::UNKNOWN_PARAM_FILTER, ['name' => json_encode($params)]);
        }

        return $result;
    }
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);
    }
661795
protected function makeResponse(string $template, array $vars = [])
    {
        if (request()->ajax()) {
            return $this->jsonOutput($vars);
        }

        return $this->renderOutput($template, $vars);
    }
835860
public function stream($view, array $parameters = [], StreamedResponse $response = null)
	{
		$templating = $this->app['templating'];

		$callback = function () use($templating, $view, $parameters) {
			$templating->stream($view, $parameters);
		};

		if (null === $response) {
			return new StreamedResponse($callback);
		}

		$response->setCallback($callback);

		return $response;
	}
706488
public function template($view, array $param = [], $return = false)
    {
        $this->setTwigEnvironment();
        $path = $this->getPath(Inflector::toDirectorySeparator($view), true);

        /*
         | We will check if tpl is holding the object of
         | twig, then we will set twig template
         | environment
         */
        if (is_object(static::$twigEnvironment)/* && is_file($path)*/) {
            $this->setTwigTemplateInstance($view);
        }
        /*
        | We will check is twig template instance exists
        | then we will render twig template with parameters
        */
        if (is_object(static::$twigEnvironment) && is_object($this->get('twig_template'))) {
            return ($return) ?
                $this->get('twig_template')->render($param) :
                $this->get('twig_template')->display($param);
        }

        return $this;
    }
752816
public function renderView($template, array $parameters = array())
    {
        $parameters['module'] = $this->module->createView();

        return $this->getContainer()->get('templating')->render($template, $parameters);
    }
7426
protected function stream(string $view, array $params = []): StreamedResponse
    {
        $templateEngine = $this->getTemplateEngine();

        $callback = function () use ($templateEngine, $view, $params) {
            echo $templateEngine->render($view, $params);
        };

        $headers = $this->getResponse()->headers->all();

        return new StreamedResponse($callback, Response::HTTP_OK, $headers);
    }
1056814
protected function renderResponse($view, array $parameters = array(), Response $response = null)
    {
        return $this->get('templating')->renderResponse($view, $parameters, $response);
    }
1286254
public static function _empty($value = null, array $params, Template $template)
    {
        if (!empty($value)) {
            return $value;
        }
        //$template = clone $template;
        $placeholders = array_merge(
            !empty($params['addPlaceholders']) ? $template->findPlaceholders($params['addPlaceholders']) : [],
            ['output' => $value]
        );

        return $template->replaceByPrefix($params['then'], $placeholders);
    }
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));
    }
1152184
public static function isParity($value, array $params, Template $template)
    {
        if (empty($params) || count($params) < 1 || !isset($params['then'])) {
            throw new TemplateException(TemplateException::UNKNOWN_PARAM_FILTER, ['name' => __METHOD__]);
        }
        $params['else'] = isset($params['else']) ? $params['else'] : null;
        $template = clone $template;
        $placeholders = [];
        $placeholders['output'] = $value;

        return NumericHelper::isParity($value)
            ? $template->replace($params['then'], $placeholders)
            : $template->replace($params['else'], $placeholders);
    }
915129
public function render($template, array $parameters = null, Response $response = null)
    {
        $parameters = array_merge([
            'request'              => $this->getRequest(),
            'routing'              => $this->routing,
            'flash_bag'            => $this->application->getSession()->getFlashBag(),
        ], $parameters ?: []);

        return $this->application->getRenderer()->partial($template, $parameters);
    }
16860
public function render($template, $context = array(), Response $response = null)
    {
        if ($response === null) {
            $response = new Response();
        }

        $response->setContent($this['mustache']->render($template, $context));

        return $response;
    }
699150
public function render(ResponseInterface $response, $template, array $data = array())
    {
        $this->view->loadFile($this->templatesPath . DIRECTORY_SEPARATOR . $template);
        $this->renderWithData($response, $data);
        return $response;
    }
1139984
public function render($template=null, array $params=[]) {
		if($template === null)
			$template = $this->template;
		$params = array_merge($this->params, $params);

		return static::renderFile($template, $params);
	}