@param string $viewType       View type
@param array  $templateParams Template parameters
@param bool   $widget         Whether to render widget

@return \Symfony\Component\HttpFoundation\Response
979375
private function renderResponse($viewType, array $templateParams = [], $widget = false)
    {
        return new Response($this->renderTemplate($viewType, $templateParams, $widget));
    }
753419
public function setTemplateType(TemplateTypeInterface $templateType)
    {
        $this->templateTypeId = $templateType->getId();

        return parent::setTemplateType($templateType);
    }
1356772
public function setViewOptions($template, array $view_data = array())
    {
        $this->view_options = $view_data;
        $this->view_template = $template;
        return $this;
    }
741662
public function renderTemplate($templateId, $request)
    {
        $query = ($request instanceof Request) ? $request->id : $request;
        return $this->sendRequest('GET', '/templates/' . $templateId . '/render?request_id=' . $query);
    }
705787
public function generateViewCss(View $view, array $widgets)
    {
        $css = '';

        foreach ($widgets as $widget) {
            $style = $this->container->get('templating')->render(
            'VictoireCoreBundle:Widget:style/style.html.twig',
            [
                'widget'                   => $widget,
                'victoire_twig_responsive' => $this->victoireTwigResponsive,
            ]
        );
            $css .= trim($style);
        }

        if ($css !== '') {
            $this->writeCssFile($view, $css);
        }
    }
841702
public function render($pagination, $template = null, array $queryParams = array(), array $viewParams = array())
    {
        return $this->environment->render(
            $template ?: $pagination->getTemplate(),
            $this->processor->render($pagination, $queryParams, $viewParams)
        );
    }
718863
public function doRenderPagination(PaginationView $view, $template = '@Pagination/pagination/default.html.twig')
    {
        if (null === $this->twig) {
            throw new \LogicException('Template component not injected to PaginationLibrary');
        }

        return $this->twig->render($template, [
            'pager' => $view,
        ]);
    }
674789
public function render($widget, $forceRender, $isDynamic)
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();
        $suffix = $isDynamic ? '_dynamic' : '';
        $output = '';

        if (!$widget || $this->shouldForceRender($forceRender)) {
            $styles = (array) $config->getGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\StyleRegistrator::STYLES_PARAMETER_NAME . $suffix);
            $output .= $this->formStylesOutput($styles);
            $output .= PHP_EOL;
            $conditionalStyles = (array) $config->getGlobalParameter(\OxidEsales\Eshop\Core\ViewHelper\StyleRegistrator::CONDITIONAL_STYLES_PARAMETER_NAME . $suffix);
            $output .= $this->formConditionalStylesOutput($conditionalStyles);
        }

        return $output;
    }
877394
public function warm(View $viewToWarm, View $contextualView = null)
    {
        $widgetMaps = [];

        if (null === $contextualView) {
            $contextualView = $viewToWarm;
        }

        foreach ($viewToWarm->getWidgetMaps() as $_widgetMap) {
            $_widgetMap->setContextualView($contextualView);
            $widgetMaps[] = $_widgetMap;
        }

        if ($template = $viewToWarm->getTemplate()) {
            $templateWidgetMaps = $this->warm($template, $contextualView);
            $widgetMaps = array_merge($widgetMaps, $templateWidgetMaps);
        }

        return $widgetMaps;
    }
224482
public function renderLoginForm(
        $widget = true,
        $actionRoute = 'darvin_user_security_login_check',
        $type = LoginType::class,
        $name = null,
        $template = null
    ) {
        if (null === $template) {
            $template = $widget ? 'DarvinUserBundle:Security/widget:login.html.twig' : 'DarvinUserBundle:Security:login.html.twig';
        }

        $form = $this->loginFormFactory->createLoginForm($actionRoute, $type, $name);

        $exception = $this->authenticationUtils->getLastAuthenticationError();

        if (!empty($exception)) {
            $form->addError(new FormError($this->translator->trans($exception->getMessage(), [], 'security')));
        }

        return $this->getTemplating()->render($template, [
            'error' => !empty($exception) ? $exception->getMessage() : null,
            'form'  => $form->createView(),
        ]);
    }
1342691
public function renderForm(Form $form, Widget $widget, $entity = null)
    {
        //the template displayed is in the widget bundle
        $templateName = $this->container->get('victoire_widget.widget_helper')->getTemplateName('edit', $widget);

        return $this->container->get('templating')->render(
            $templateName,
            [
                'widget' => $widget,
                'slot'   => $widget->getWidgetMap()->getSlot(),
                'view'   => $this->container->get('victoire_core.current_view')->getCurrentView(),
                'form'   => $form->createView(),
                'id'     => $widget->getId(),
                'entity' => $entity,
            ]
        );
    }
1272830
public function render(string $view, array $templateVars = []): string
    {
        return $this->renderer->render($view, $templateVars);
    }
876975
private function renderNewTemplate($widget, FormInterface $form, $parentEntity)
    {
        return $this->renderTemplate('new', [
            'ajax_form'     => $widget,
            'form'          => $form->createView(),
            'meta'          => $this->meta,
            'parent_entity' => $parentEntity,
        ], $widget);
    }
1357405
protected function makeTemplateFormWidget($type, $template, $alias = null)
    {
        $formConfigs = [
            'page'    => '~/modules/cms/classes/page/fields.yaml',
            'partial' => '~/modules/cms/classes/partial/fields.yaml',
            'layout'  => '~/modules/cms/classes/layout/fields.yaml',
            'content' => '~/modules/cms/classes/content/fields.yaml',
            'asset'   => '~/modules/cms/classes/asset/fields.yaml'
        ];

        if (!array_key_exists($type, $formConfigs)) {
            throw new ApplicationException(trans('cms::lang.template.not_found'));
        }

        $widgetConfig = $this->makeConfig($formConfigs[$type]);
        $widgetConfig->model = $template;
        $widgetConfig->alias = $alias ?: 'form'.studly_case($type).md5($template->getFileName()).uniqid();

        return $this->makeWidget('Backend\Widgets\Form', $widgetConfig);
    }
204402
public function handle(\Exception $ex, $currentView, $widget = null, $widgetId = null)
    {
        $templating = $this->container->get('templating');

        $result = '';

        //
        if ($this->debug) {
            $exceptionResult = '<div style="border: 3px solid #FF0000;height: 500px;overflow: auto;">';

            $template = new TemplateReference('TwigBundle', 'Exception', 'exception', 'html', 'twig');
            $exception = FlattenException::create($ex);
            $exceptionResult = $templating->render(
                $template,
                [
                    'status_code'    => $ex->getCode(),
                    'status_text'    => 500,
                    'exception'      => $exception,
                    'logger'         => null,
                    'currentContent' => null,
                ]
            );

            $exceptionResult .= '</div>';

            //only a user victoire can see that there is an error
            $result = $templating->render(
                'VictoireCoreBundle:Widget:showError.html.twig',
                [
                    'widget'      => $widget,
                    'widgetId'    => $widgetId,
                    'currentView' => $currentView,
                    'error'       => $exceptionResult,
                ]
            );
        } else {
            //environnement not debug
            //only a user victoire can see that there is an error
            if ($this->authorizationChecker->isGranted('ROLE_VICTOIRE')) {
                $result = $templating->render(
                    'VictoireCoreBundle:Widget:showError.html.twig',
                    [
                        'widget'      => $widget,
                        'widgetId'    => $widgetId,
                        'currentView' => $currentView,
                        'error'       => $ex->getMessage(),
                    ]
                );
            }
        }

        return $result;
    }
482332
protected function display($templateFile='',$charset='',$contentType='',$content='',$prefix='') {
        $this->view->display($templateFile,$charset,$contentType,$content,$prefix);
    }
221803
public function render($templateName = null, $data = [])
    {
        $this->setTemplate($templateName, $data);

        if (empty($this->_templateName)) {
            if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                $this->getLogger()->debug('template name is null');
            }

            throw new \RuntimeException('TEMPLATE_IS_NULL');
        }
        $buffer = $this->_parseTemplate($this->_templateName, $this->_data);
        if (!empty($this->_layout)) {
            if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                $this->getLogger()->debug('loading layout: '.$this->_layout);
            }

            $buffer = $this->_parseTemplate(
                $this->_layout,
                array_merge($this->_data, ['__body__' => $buffer])
            );
        }

        return $buffer;
    }