renderJsonAction

@param string $view   the view to render
@param string $layout the layout to render
@return \FrontendBridge\Lib\ServiceResponse
2680
public function renderJsonAction($view, $layout): ServiceResponse
    {
        $layout = $this->getLayout($layout);
        if ($this->RequestHandler) {
            // Make sure the view is rendered as HTML, even if it is an AJAX request
            // jsonActionResponse() will make sure the JSON response is rendered correctly
            $this->RequestHandler->renderAs($this, 'ajax');
            $this->RequestHandler->ext = 'html';
        }
        $response = parent::render($view, $layout);

        return $this->jsonActionResponse($response);
    }
1056814
protected function renderResponse($view, array $parameters = array(), Response $response = null)
    {
        return $this->get('templating')->renderResponse($view, $parameters, $response);
    }
653248
public function renderView($viewPath = null, $data = [], $layout = null)
    {
        ob_start();
        require($viewPath);
        $viewData = ob_get_contents();
        ob_end_clean();
        foreach($data as $key => $val) {
            if(is_array($val)) {
                if($key == 'meta') {
                    $this->data['meta'] = $val;
                }
            }
            else {
                $viewData = str_replace('{{'.$key.'}}', $val, $viewData);
            }
        }
        return $viewData;
    }
173604
public function render($view = null)
    {
        if (is_null($view)) {
            $view = config('navigation.view.badge', 'navigation::badge');
        }

        return view($view, $this->toArray());
    }
1120914
public function view($layout, $name=null)
	{
		// If we were passed only a view model, just render it.
		if ($layout instanceof AbstractView)
		{
			return $layout;
		}

		$view = new self(array(
			'base_path' => $this->_basePath,
			'name'      => ($name ? $name : $this->_name),
			'layout'    => $layout
		));
		$view->set('option', $this->option)
		     ->set('controller', $this->controller)
		     ->set('task', $this->task);

		return $view;
	}
938563
public function render($view = null, $layout = null)
    {
        $content = parent::render($view, $layout);

        if (version_compare(Configure::version(), '3.6.0', '<')) {
            $type = $this->response->type();
        } else {
            $type = $this->response->getType();
        }

        if ($type === 'text/html') {
            return $content;
        }
        if ($this->renderer() === null) {
            $this->response = $this->response->withType('html');

            return $content;
        }

        if (!empty($this->pdfConfig['filename']) || !empty($this->pdfConfig['download'])) {
            $this->response = $this->response->withDownload($this->getFilename());
        }

        $this->Blocks->set('content', $this->renderer()->output($content));

        return $this->Blocks->get('content');
    }
657509
public function render($view, array $parameters = [], Response $response = null)
    {
        return $this->templating->renderResponse($view, $parameters, $response);
    }
866251
public function render($view = null, $layout = null)
    {
        $content = parent::render($view, $layout);
        if ($this->response->type() == 'text/html') {
            return $content;
        }

        $this->Blocks->set('content', $this->output());
        $this->response->download($this->getFilename());

        return $this->Blocks->get('content');
    }
271415
function render(view, options) {
  var self = this;
  options = options || {};

  for (var name in settings._filters) {
    options[name] = settings._filters[name];
  }

  if (settings.helpers) {
    for (var k in settings.helpers) {
      var helper = settings.helpers[k];
      if (typeof helper === 'function') {
        helper = helper(self.req, self);
      }
      if (!options.hasOwnProperty(k)) {
        options[k] = helper;
      }
    }
  }

  if (settings.filters) {
    for (var name in settings.filters) {
      options[name] = settings.filters[name];
    }
  }

  // add request to options
  if (!options.request) {
    options.request = self.req;
  }
  // render view template
  _render(view, options, function (err, str) {
    if (err) {
      return self.req.next(err);
    }
    var layout = typeof options.layout === 'string' ? options.layout : settings.layout;
    if (options.layout === false || !layout) {
      return send(self, str);
    }
    // render layout template, add view str to layout's locals.body;
    options.body = str;
    _render(layout, options, function (err, str) {
      if (err) {
        return self.req.next(err);
      }
      send(self, str);
    });
  });
  return this;
}
809472
private function render($view, array $parameters = [])
    {
        $response = new LegacyResponse();
        $response->setContent($this->templateEngine->render($view, $parameters));

        return $response;
    }
1276721
public function render(string $view, array $params = []): string
    {
        return $this->make($view, $params)->render();
    }
461188
public function render($view, array $locals = [])
    {
        $locals = $locals + [
            '_layout' => $this->layout
        ];

        return new Response(function($resp) use ($view, $locals) {
            $resp->body = $this->renderView($view, $locals);
        });
    }
797205
protected function renderView(array $view)
    {
        if (!array_key_exists('view', $view)) {
            return "";
        }
        $options = (array_key_exists('options', $view)) ? $view['options'] : array();

        return $this->templating->render($view['view'], $options);
    }
681522
public function render($view = null)
    {
        if (is_null($view) and ! isset($this->templatePaths[$this->defaultLanguage])) {
            return '';
        }
        $return   = (is_null($view)) ? view($this->templatePaths[$this->defaultLanguage], $this->predefinedVariables) : view($view, $this->predefinedVariables);
        $adapter  = app(VariablesAdapter::class);
        $rendered = $adapter->fill($return->__toString());
        preg_match_all('/\[\[(.*?)\]\]/', $rendered, $matches);
        if (isset($matches[0]) && isset($matches[1])) {
            foreach ($matches[0] as $index => $variable) {
                $rendered = str_replace($variable, '{{ ' . $matches[1][$index] . ' }}', $rendered);
            }
            $twig = new Twig_Environment(new Twig_Loader_String());
            return $twig->render($rendered, $this->predefinedVariables);
        }

        return $rendered;
    }
265585
public function render(View $view)
    {
        $handler = $this->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->render($this, $view);
        }

        return '';
    }
949037
public function render($view, array $data = null)
	{
		// Sanitize variables already in the template.
		foreach (get_object_vars($this) as $key => $value) {
			if (!in_array($key, $this->unguarded)) {
				$this->$key = $this->scrub($value);
			}
		}

		// Also sanitize any variables we are passing in to the template
		$data = $this->scrub($data);

		return parent::render($view, $data);
	}
438941
public function renderPage($view, $layout = null)
    {
        $event = new PageMenuContextualEvent($view);

        //Set currentView and dispatch victoire.on_render_page event with this currentView
        $pageRenderEvent = new PageRenderEvent($view);
        $this->eventDispatcher->dispatch('victoire.on_render_page', $pageRenderEvent);
        $this->currentViewHelper->setCurrentView($view);

        //Build WidgetMap
        $this->widgetMapBuilder->build($view, true);

        //Populate widgets with their data
        $this->widgetDataWarmer->warm($this->entityManager, $view);

        //Dispatch contextual event regarding page type
        if (in_array($view->getType(), ['business_page', 'virtual_business_page'])) {
            //Dispatch also an event with the Business entity name
            $eventName = 'victoire_core.page_menu.contextual';
            if (!$view->getId()) {
                $eventName = 'victoire_core.business_template_menu.contextual';
                $event = new PageMenuContextualEvent($view->getTemplate());
            }
            $this->eventDispatcher->dispatch($eventName, $event);
            $type = $view->getBusinessEntityId();
        } else {
            $type = $view->getType();
        }

        $eventName = 'victoire_core.'.$type.'_menu.contextual';
        $this->eventDispatcher->dispatch($eventName, $event);

        if (null === $layout) {
            //Determine which layout to use
            $layout = $this->guessBestLayoutForView($view);
        }
        $globalConfig = $this->entityManager->getRepository(GlobalConfig::class)->findLast() ?: new GlobalConfig();

        //Create the response
        $response = $this->container->get('templating')->renderResponse('VictoireCoreBundle:Layout:'.$layout.'.html.twig', [
            'globalConfig'                    => $globalConfig,
            'victoire_i18n_available_locales' => $this->availableLocales,
            'victoire_twig_responsive'        => $this->twigResponsive,
            'view'                            => $view,
        ]);

        return $response;
    }