public function createComponentFileBrowser() { $control = $this->fileBrowserControlFactory->invoke(); $control->setBrowserMode((bool) $this->browserMode); if ($this->type) { if ($this->type == 'page') { $control->setRoot($this->pageRepository->find($this->page)->dir); } elseif ($this->type == 'route') { $control->setRoot($this->routeRepository->find($this->route)->dir); } } return $control; }
/** * @return RouteEntity * @throws \Nette\Application\BadRequestException */ public function getRoute() { if (!$this->_route) { if (($this->_route = $this->routeRepository->find($this->routeId)) === NULL) { throw new BadRequestException(); } } return $this->_route; }