Exemplo n.º 1
0
 /**
  * @return RouteList
  */
 protected function createWeb()
 {
     $router = new RouteList();
     if ($this->httpRequest->isSecured()) {
         Route::$defaultFlags = Route::SECURED;
     }
     // FRONT ===========================================
     $router[] = $front = new RouteList('Front');
     $front[] = new Route('sitemap.xml', 'Generator:sitemap');
     $front[] = new Route('<slug [a-zA-Z0-9\\-\\.]+/[a-zA-Z0-9\\-\\.]+>/', ['presenter' => 'Addon', 'action' => 'detail', 'slug' => [Route::FILTER_IN => [$this->addonsHelper, 'addonIn'], Route::FILTER_OUT => [$this->addonsHelper, 'addonOut']]]);
     $front[] = new Route('<slug [a-zA-Z0-9\\-\\.]+>/', ['presenter' => 'List', 'action' => 'owner', 'slug' => [Route::FILTER_IN => [$this->addonsHelper, 'ownerIn'], Route::FILTER_OUT => [$this->addonsHelper, 'ownerOut']]]);
     $front[] = new Route('all/', 'List:default');
     $front[] = new Route('search/', 'List:search');
     $front[] = new Route('search/<tag>', 'List:tag');
     $front[] = new Route('status/', 'Status:default');
     $front[] = new Route('<presenter>/<action>', 'Home:default');
     return $router;
 }
 /**
  * @param string $basePath = self::BASE_PATH
  * @param Request $request
  * @return IRouter
  */
 public static function createRouter($basePath = self::BASE_PATH, Request $request)
 {
     $secured = $request->isSecured();
     $installRouter = new RouteList('Install');
     $installRouter[] = $devSubmoduleRouter = new RouteList('Dev');
     $devSubmoduleRouter[] = new Route($basePath . 'dev/<presenter=Default>[/<action=default>]', [], $secured ? Route::SECURED : 0);
     $installRouter[] = new Route($basePath . '<presenter=Default>[/<action=default>]', [], $secured ? Route::SECURED : 0);
     return $installRouter;
 }
Exemplo n.º 3
0
 public function isSecured()
 {
     return $this->request->isSecured();
 }
Exemplo n.º 4
0
 /**
  * Creates Nette Application request
  * @return \Nette\Application\Request
  */
 public function createApplicationRequest()
 {
     list($presenter, $action) = $this->getDestination();
     $data = $this->getData($presenter . ':' . $action);
     return new \Nette\Application\Request($this->module . ":" . $presenter, $this->httpRequest->getMethod(), array_merge(['action' => $action], $data), $this->httpRequest->getPost(), $this->httpRequest->getFiles(), array(\Nette\Application\Request::SECURED => $this->httpRequest->isSecured()));
 }