コード例 #1
0
ファイル: Module.php プロジェクト: kobmaki/icingaweb2
 /**
  * Add routes for static content and any route added via {@link addRoute()} to the route chain
  *
  * @return $this
  */
 protected function registerRoutes()
 {
     $router = $this->app->getFrontController()->getRouter();
     // TODO: We should not be required to do this. Please check dispatch()
     $this->app->getfrontController()->addControllerDirectory($this->getControllerDir(), $this->getName());
     /** @var \Zend_Controller_Router_Rewrite $router */
     foreach ($this->routes as $name => $route) {
         $router->addRoute($name, $route);
     }
     $router->addRoute($this->name . '_jsprovider', new Zend_Controller_Router_Route('js/' . $this->name . '/:file', array('action' => 'javascript', 'controller' => 'static', 'module' => 'default', 'module_name' => $this->name)));
     $router->addRoute($this->name . '_img', new Zend_Controller_Router_Route_Regex('img/' . $this->name . '/(.+)', array('action' => 'img', 'controller' => 'static', 'module' => 'default', 'module_name' => $this->name), array(1 => 'file')));
     return $this;
 }
コード例 #2
0
ファイル: Module.php プロジェクト: vbereza/icinga2-migration
 /**
  * Register routes for web access
  *
  * @return self
  */
 protected function registerRoutes()
 {
     $this->app->getFrontController()->getRouter()->addRoute($this->name . '_jsprovider', new Route('js/' . $this->name . '/:file', array('controller' => 'static', 'action' => 'javascript', 'module_name' => $this->name)));
     $this->app->getFrontController()->getRouter()->addRoute($this->name . '_img', new Route('img/' . $this->name . '/:file', array('controller' => 'static', 'action' => 'img', 'module_name' => $this->name)));
     return $this;
 }
コード例 #3
0
ファイル: Module.php プロジェクト: AndHab/icingaweb2
 /**
  * Add routes for static content and any route added via {@link addRoute()} to the route chain
  *
  * @return $this
  */
 protected function registerRoutes()
 {
     $router = $this->app->getFrontController()->getRouter();
     /** @var \Zend_Controller_Router_Rewrite $router */
     foreach ($this->routes as $name => $route) {
         $router->addRoute($name, $route);
     }
     $router->addRoute($this->name . '_jsprovider', new Zend_Controller_Router_Route('js/' . $this->name . '/:file', array('action' => 'javascript', 'controller' => 'static', 'module' => 'default', 'module_name' => $this->name)));
     $router->addRoute($this->name . '_img', new Zend_Controller_Router_Route_Regex('img/' . $this->name . '/(.+)', array('action' => 'img', 'controller' => 'static', 'module' => 'default', 'module_name' => $this->name), array(1 => 'file')));
     return $this;
 }