Skip to content

Instantly share code, notes, and snippets.

@mlebkowski
Created April 7, 2016 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlebkowski/a24305e525a8411ce53a58da4a956397 to your computer and use it in GitHub Desktop.
Save mlebkowski/a24305e525a8411ce53a58da4a956397 to your computer and use it in GitHub Desktop.
<?php
/**
* @inheritDoc
*/
protected function renderCustomSearchView(NodeTranslation $nodeTranslation, SearchViewTemplateInterface $page)
{
$view = $page->getSearchView();
$renderContext = new RenderContext([
'locale' => $nodeTranslation->getLang(),
'page' => $page,
'indexMode' => true
]);
if ($page instanceof PageInterface) {
$request = $this->container->get('request_stack')->getCurrentRequest();
$page->service($this->container, $request, $renderContext);
}
$content = $this->removeHtml($this->container->get('templating')->render($view, $renderContext->getArrayCopy()));
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment