Ejemplo n.º 1
0
 /**
  * @inheritDoc
  */
 public function loadState(array $params)
 {
     if (!($request = $params['request'] ?? $this->application->getRouter()->match($httpRequest = $this->getHttpRequest()))) {
         $request = $this->application->getRouter()->match(new Nette\Http\Request(new Nette\Http\UrlScript($httpRequest->getUrl()->getBaseUrl())));
     }
     if ($request) {
         $this->application->onRequest($this->application, $request);
         $params += $request->getParameters();
     }
     try {
         parent::loadState($params);
     } catch (Nette\Application\BadRequestException $exception) {
         if (!$this->web) {
             $this->web = new Ytnuk\Web\Entity();
             $this->web->menu = new Ytnuk\Menu\Entity();
         }
     }
 }