@param string   $view
@param array    $parameters
@param Response $response

@return Response
170533
public function renderWithExtraParams($view, array $parameters = [], Response $response = null)
    {
        if (array_key_exists('action', $parameters) && $parameters['action'] == 'edit') {
            $event = new CmsEvent($parameters['object']);

            $this->dispatcher->dispatch(self::EDIT_ENTITY, $event);
        }

        return parent::renderWithExtraParams($view, $parameters, $response);
    }
40462
protected function viewResponse($view, $data = array(), $status = 200, array $headers = array())
	{
		return $this->response($this->view($view, $data), $status, $headers);
	}
784391
public function renderWithExtraParams($view, array $parameters = [], Response $response = null)
    {
        if (!$this->isXmlHttpRequest()) {
            $parameters['breadcrumbs_builder'] = $this->get('sonata.admin.breadcrumbs_builder');
        }
        $parameters['admin'] = $parameters['admin'] ??
            $this->admin;

        $parameters['base_template'] = $parameters['base_template'] ??
            $this->getBaseTemplate();

        $parameters['admin_pool'] = $this->get('sonata.admin.pool');

        //NEXT_MAJOR: Remove method alias and use $this->render() directly.
        return $this->originalRender($view, $parameters, $response);
    }
1020423
protected function render(string $view, array $parameters = [], Response $response = null): Response
    {
        if ($this->container->has('templating')) {
            @trigger_error('Using the "templating" service is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.', E_USER_DEPRECATED);

            $content = $this->container->get('templating')->render($view, $parameters);
        } elseif ($this->container->has('twig')) {
            $content = $this->container->get('twig')->render($view, $parameters);
        } else {
            throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".');
        }

        if (null === $response) {
            $response = new Response();
        }

        $response->setContent($content);

        return $response;
    }
1330334
public function renderResponse(BlockInterface $block, array $parameters = array(), Response $response = null)
    {
        $view = $this->getView($block);

        if ($response) {
            $this->setResponseHeaders($block, $response);
        }

        return $this->blockRenderer->render($view, $parameters, $response);
    }
425972
public function render($template, array $parameters = null, Response $response = null)
    {
        return parent::render($this->bundle->getBaseDirectory().DIRECTORY_SEPARATOR.'Templates'.DIRECTORY_SEPARATOR.'scripts'.DIRECTORY_SEPARATOR.$template, $parameters, $response);
    }
521505
protected function makeView($view)
    {
        if( Auth::check() ) {
            $this->addParameter( 'activeUser', Auth::user() );
        }

        return View::make( $view, $this->parameters );
    }
115562
public function execute($action, array $parameters = []) {
        $result = null;
        if (is_string($action)) {
            $actionParts = explode("@", $action);
            $controllerClass = $actionParts[0];
            $controllerMethodName = sizeof($actionParts) > 1 ? $actionParts[1] : "index";
            $controller = Controllers::get($controllerClass);
            if ($controller == null) {
                throw new ActionNotFoundException ( "Controller \"$controllerClass\" not found !!");
            }
            if (method_exists($controller, $controllerMethodName)) {
                $controllerMethodParams = $this->getParameterValues(new ReflectionMethod($controller, $controllerMethodName), $parameters);
                $result = call_user_func_array([$controller, $controllerMethodName], $controllerMethodParams);
            }
            else {
                throw new ActionNotFoundException ("Method \"$controllerMethodName\" not found in controller \"$controllerClass\" !!");
            }
        }
        else if (is_callable($action)) {
            $actionParams = $this->getParameterValues(new ReflectionFunction($action), $parameters);
            $result = call_user_func_array($action, $actionParams);
        }
        return $result;
    }
752816
public function renderView($template, array $parameters = array())
    {
        $parameters['module'] = $this->module->createView();

        return $this->getContainer()->get('templating')->render($template, $parameters);
    }
996642
public function render($view, array $parameters = array(), Response $response = null)
    {
        if ($response === null) {
            $response = new Response();
        }

        $json = Encoder::encodeFromFile($this->getPath($view), $parameters);
        $response->setContent($json);

        return $response;
    }
466828
public function callAction($method, $parameters)
    {
        $response = call_user_func_array([$this, $method], $parameters);

        if (is_null($response) && ! is_null($this->layout)) {
            $response = $this->layout;
        }

        return $response;
    }
350799
public function render($viewFile, $parameters = [], Response $response = null)
    {
        if (null === $response) {
            $response = new Response();
        }

        return $response->setContent($this->getContent($viewFile, $parameters));
    }
809472
private function render($view, array $parameters = [])
    {
        $response = new LegacyResponse();
        $response->setContent($this->templateEngine->render($view, $parameters));

        return $response;
    }
1129329
protected function renderTemplate($view, array $parameters, $checksum)
    {
        $view = sprintf('%s_%s', $view, $checksum);

        return $this->renderer->renderTemplate($view, $parameters);
    }
412928
public function callAction($method, $parameters)
    {
        $result = null;
        $this->setupLayout($method);

        // Call the action if $this->general() doesn't suggest otherwise
        if (method_exists($this, 'general'))
            $result = $this->general();
        if (!$result)
            $result = parent::callAction($method, $parameters);

        return isset($result) ? $result : $this->layout; // must use isset() for case of empty array in AJAX response
    }
890708
private function responseView(ServerRequestInterface $request, ResponseInterface $response)
    {
        $ctx   = Context::mustGet();
        $views = ViewRegister::getViews();

        // the info of view model
        $controllerClass  = $ctx->get('controllerClass');
        $controllerAction = $ctx->get('controllerAction');

        $actionId = $controllerClass . '@' . $controllerAction;
        if (!isset($views[$actionId])) {
            return $response;
        }

        // Get layout and template
        [$layout, $template] = $views[$actionId];

        // accept and the of response
        $accepts       = $request->getHeader('accept');
        $currentAccept = \current($accepts);

        /* @var \Swoft\Http\Message\Response $response */
        $responseAttribute = AttributeEnum::RESPONSE_ATTRIBUTE;

        $data = $response->getAttribute($responseAttribute);

        // the condition of view
        $isTextHtml = !empty($currentAccept) && $response->isMatchAccept($currentAccept, 'text/html');
        $isTemplate = $controllerClass && $response->isArrayable($data) && $template;

        // show view
        if ($isTextHtml && $isTemplate) {
            if ($data instanceof Arrayable) {
                $data = $data->toArray();
            }

            /* @var \Swoft\View\Renderer $view */
            $view     = \Swoft::getBean('view');
            $content  = $view->render($template, $data, $layout);
            $response = $response
                ->withContent($content)
                ->withAttribute($responseAttribute, null)
                ->withoutHeader('Content-Type')->withAddedHeader('Content-Type', 'text/html');
        }

        return $response;
    }
955388
public function settingsPostAction(Request $request, View $view)
    {
        $em = $this->getDoctrine()->getManager();

        $pageSeo = $view->getSeo() ?: new PageSeo();
        $form = $this->createSettingsForm($pageSeo, $view);

        $form->handleRequest($request);
        $novalidate = $request->query->get('novalidate', false);

        if (false === $novalidate && $form->isValid()) {
            $em->persist($pageSeo);
            $view->setSeo($pageSeo);
            $em->persist($view);
            $em->flush();

            $this->get('victoire_core.current_view')->setCurrentView($view);
            $this->congrat('victoire_seo.save.success');

            $response = [
                'success' => true,
                'url'     => $this->getViewUrl($view),
            ];
        } else {
            $response = $this->getNotPersistedSettingsResponse($form, $view, $novalidate);
        }

        return new JsonResponse($response);
    }