Sulu\Component\Webspace\Analyzer\RequestAnalyzerInterface::analyze PHP Method

analyze() public method

Analyzes the current request, and saves the values for portal, language, country and segment for further usage.
public analyze ( Request $request )
$request Symfony\Component\HttpFoundation\Request The request to analyze
    public function analyze(Request $request);

Usage Example

Example #1
0
 /**
  * Analyzes the request before passing the event to the default RouterListener from symfony and validates the result
  * afterwards.
  *
  * @param GetResponseEvent $event
  */
 public function onKernelRequest(GetResponseEvent $event)
 {
     $request = $event->getRequest();
     // This call is required in all cases, because the default router needs our webspace information
     // Would be nice to also only call this if the _requestAnalyzer attribute is set, but it's set on the next line
     $this->requestAnalyzer->analyze($request);
     $this->baseRouteListener->onKernelRequest($event);
     if ($request->attributes->get(static::REQUEST_ANALYZER, true) !== false) {
         $this->requestAnalyzer->validate($request);
     }
 }
All Usage Examples Of Sulu\Component\Webspace\Analyzer\RequestAnalyzerInterface::analyze