当前位置: 首页>>代码示例>>PHP>>正文


PHP Router::__construct方法代码示例

本文整理汇总了PHP中Phalcon\Mvc\Router::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::__construct方法的具体用法?PHP Router::__construct怎么用?PHP Router::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phalcon\Mvc\Router的用法示例。


在下文中一共展示了Router::__construct方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     parent::__construct(false);
     $this->add('/admin', ['module' => 'backend', 'controller' => 'index', 'action' => 'index']);
     $this->add('/index', ['module' => 'frontend', 'controller' => 'index', 'action' => 'index']);
     $this->add('/', ['module' => 'frontend', 'controller' => 'index', 'action' => 'index']);
 }
开发者ID:xsat,项目名称:www.mail.com,代码行数:7,代码来源:Router.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setDefaultController('index');
     $this->setDefaultAction('index');
     $this->add('/:module/:controller/:action/:params', ['module' => 1, 'controller' => 2, 'action' => 3, 'params' => 4])->setName('default');
     $this->add('/:module/:controller', ['module' => 1, 'controller' => 2, 'action' => 'index'])->setName('default_action');
     $this->add('/:module', ['module' => 1, 'controller' => 'index', 'action' => 'index'])->setName('default_controller');
 }
开发者ID:devsnippet,项目名称:yona-cms,代码行数:9,代码来源:DefaultRouter.php

示例3: __construct

 public function __construct(DiInterface $di)
 {
     parent::__construct(false);
     $this->clear();
     $this->removeExtraSlashes(true);
     $this->setUriSource(PhalconRouter::URI_SOURCE_SERVER_REQUEST_URI);
     $this->setDefaultAction('index');
     $this->setDefaultController('index');
     $this->setDI($di);
     $this->notFound(['controller' => 'error', 'action' => 'not-found']);
 }
开发者ID:tmquang6805,项目名称:phalex,代码行数:11,代码来源:Router.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setDefaultController('index');
     $this->setDefaultAction('index');
     // $this->setDefaultModule("admin");
     $this->add('/:module/:controller/:action/:params', ['module' => 1, 'controller' => 2, 'action' => 3, 'params' => 4])->setName('default');
     $this->add('/:module/:controller', ['module' => 1, 'controller' => 2, 'action' => 'index'])->setName('default_action');
     $this->add('/:module', ['module' => 1, 'controller' => 'index', 'action' => 'index'])->setName('default_controller');
     //暂时使用后台管理当首页
     $this->add('/', ['module' => 'admin', 'controller' => 'index', 'action' => 'index'])->setName('default_controller');
     $this->removeExtraSlashes(true);
 }
开发者ID:abc2001x,项目名称:phalcon_mode,代码行数:13,代码来源:DefaultRouter.php

示例5: __construct

 public function __construct()
 {
     parent::__construct(false);
     static::$runningUnitTest = Config::runningUnitTest();
     // @codeCoverageIgnoreStart
     if ($this->_sitePathPrefix = Config::get('app.site_path')) {
         $this->_uriSource = self::URI_SOURCE_GET_URL;
         $this->_sitePathLength = strlen($this->_sitePathPrefix);
     }
     // @codeCoverageIgnoreEnd
     $this->removeExtraSlashes(true);
     $routes = is_file($file = $_SERVER['PHWOOLCON_ROOT_PATH'] . '/app/routes.php') ? include $file : [];
     is_array($routes) and $this->addRoutes($routes);
     $this->cookies = static::$di->getShared('cookies');
     $this->response = static::$di->getShared('response');
     $this->response->setStatusCode(200);
 }
开发者ID:phwoolcon,项目名称:phwoolcon,代码行数:17,代码来源:Router.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $session = \Phalcon\DI::getDefault()->getSession();
     //Set the default namespace for all controllers that doesn't match our custom routes
     //e.g '/auth/login' will route to something like 'MyApp\Controllers\AuthController::loginAction()'
     $this->setDefaultNamespace('PRIME\\Controllers\\');
     //Our custom routes will not use slashes at the of the URIs
     $this->removeExtraSlashes(true);
     if ($session->has("auth")) {
         //Retrieve its value
         $auth = $session->get("auth");
         $this->theme = $auth['theme'];
         $directory = '../app/themes/' . $this->theme . '/widgets/';
         //get all files in specified directory
         $files = glob($directory . "*", GLOB_ONLYDIR);
         $files = array_map('basename', $files);
         $this->themeLevel2SetupNamespacedRoutes("widgets", $files);
         $directory = '../app/authenticators/';
         //get all files in specified directory
         $files = glob($directory . "*", GLOB_ONLYDIR);
         $files = array_map('basename', $files);
         $this->level2SetupNamespacedRoutes("authenticators", $files);
         $directory = '../app/form_elements/';
         //get all files in specified directory
         $files = glob($directory . "*", GLOB_ONLYDIR);
         $files = array_map('basename', $files);
         $this->level2SetupNamespacedRoutes("form_elements", $files);
         $directory = '../app/data_connectors/';
         //get all files in specified directory
         $files = glob($directory . "*", GLOB_ONLYDIR);
         $files = array_map('basename', $files);
         $this->level2SetupNamespacedRoutes("data_connectors", $files);
         $directory = '../app/themes/' . $this->theme . '/portlets/';
         $this->themeLevel1SetupNamespacedRoutes("portlets");
         $directory = '../app/themes/' . $this->theme . '/dashboards/';
         $this->themeLevel1SetupNamespacedRoutes("dashboards");
         $directory = '../app/themes/' . $this->theme . '/logins/';
         $this->themeLevel1SetupNamespacedRoutes("logins");
     }
 }
开发者ID:enricowillemse,项目名称:prime_admin,代码行数:41,代码来源:Router.php

示例7: __construct

 /**
  * myRouter constructor.
  */
 public function __construct($defaultRoutes = true)
 {
     parent::__construct($defaultRoutes);
 }
开发者ID:huoybb,项目名称:standard,代码行数:7,代码来源:myRouter.php

示例8: __construct

 public function __construct($bool)
 {
     parent::__construct($bool);
 }
开发者ID:ps-clarity,项目名称:support,代码行数:4,代码来源:Router.php

示例9: __construct

 /**
  * Standard router constructor
  *
  * @param DiInterface $dependencyInjector
  * @param bool $keepDefaultRoutes
  */
 public function __construct(DiInterface $dependencyInjector, $keepDefaultRoutes = false)
 {
     parent::__construct($keepDefaultRoutes);
     $this->removeExtraSlashes(true);
     $this->setDI($dependencyInjector);
 }
开发者ID:arius86,项目名称:core,代码行数:12,代码来源:Standard.php

示例10: __construct

 public function __construct(array $routes, $defaultRoute = false)
 {
     parent::__construct(false);
     $this->setUriSource(static::URI_SOURCE_SERVER_REQUEST_URI);
     $this->routes = $routes;
 }
开发者ID:broklyngagah,项目名称:orbit,代码行数:6,代码来源:Router.php

示例11: __construct

 public function __construct()
 {
     parent::__construct(false);
     $this->removeExtraSlashes(true);
 }
开发者ID:dubhunter,项目名称:talon,代码行数:5,代码来源:RestRouter.php

示例12: __construct

 public function __construct($defaultRoutes = null, ILangService $lang = null)
 {
     $this->lang = $lang;
     parent::__construct($defaultRoutes);
 }
开发者ID:kathynka,项目名称:Foundation,代码行数:5,代码来源:LangRouter.php

示例13: __construct

 /**
  * Create a new extended Phalcon router.
  * 
  * @param boolean $default            
  * @param boolean $removeExtraSlashes
  */
 public function __construct($default = false, $removeExtraSlashes = true)
 {
     parent::__construct($default);
     $this->removeExtraSlashes($removeExtraSlashes);
 }
开发者ID:halfbakedsneed,项目名称:phalcore,代码行数:11,代码来源:Router.php


注:本文中的Phalcon\Mvc\Router::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。