Example #1
0
 /**
  * {@inheritdoc}
  */
 public function match($pathInfo, Context $context)
 {
     if (strpos($pathInfo, '/backend/') === 0 || strpos($pathInfo, '/api/') === 0) {
         return $pathInfo;
     }
     if ($context->getShopId() === null) {
         //only frontend
         return $pathInfo;
     }
     $request = new EnlightRequest();
     $request->setBaseUrl($context->getBaseUrl());
     $request->setPathInfo($pathInfo);
     $event = $this->eventManager->notifyUntil('Enlight_Controller_Router_Route', ['request' => $request, 'context' => $context]);
     return $event !== null ? $event->getReturn() : false;
 }