當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。