Sulu\Bundle\WebsiteBundle\Resolver\ParameterResolverInterface::resolve PHP Method

resolve() public method

Resolves parameter for website controller.
public resolve ( array $parameter, Sulu\Component\Webspace\Analyzer\RequestAnalyzerInterface $requestAnalyzer = null, Sulu\Component\Content\Compat\StructureInterface $structure = null, boolean $preview = false ) : mixed
$parameter array
$requestAnalyzer Sulu\Component\Webspace\Analyzer\RequestAnalyzerInterface
$structure Sulu\Component\Content\Compat\StructureInterface
$preview boolean
return mixed
    public function resolve(array $parameter, RequestAnalyzerInterface $requestAnalyzer = null, StructureInterface $structure = null, $preview = false);

Usage Example

コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null)
 {
     $code = $exception->getStatusCode();
     $showException = $request->attributes->get('showException', $this->debug);
     $template = $this->requestAnalyzer->getWebspace()->getTheme()->getErrorTemplate($code);
     if ($showException || $request->getRequestFormat() !== 'html' || $template === null) {
         return parent::showAction($request, $exception, $logger);
     }
     $currentContent = $this->getAndCleanOutputBuffering($request->headers->get('X-Php-Ob-Level', -1));
     $parameter = ['status_code' => $code, 'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '', 'exception' => $exception, 'currentContent' => $currentContent];
     $data = $this->parameterResolver->resolve($parameter, $this->requestAnalyzer);
     return new Response($this->twig->render($template, $data), $code);
 }
All Usage Examples Of Sulu\Bundle\WebsiteBundle\Resolver\ParameterResolverInterface::resolve
ParameterResolverInterface