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


PHP Module::createController方法代码示例

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


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

示例1: createController

 public function createController($route)
 {
     if ($this->beforeCreateController !== null && !call_user_func($this->beforeCreateController, $route)) {
         return false;
     }
     return parent::createController($route);
 }
开发者ID:MikleUA,项目名称:yii2-rbac-plus,代码行数:7,代码来源:Module.php

示例2: createController

 /**
  * Override createController()
  * @link https://github.com/yiisoft/yii2/issues/810
  * @link http://www.yiiframework.com/forum/index.php/topic/21884-module-and-url-management/
  *
  * @param string $route
  *
  * @return array|bool
  */
 public function createController($route)
 {
     preg_match('/(default)/', $route, $match);
     if (isset($match[0])) {
         return parent::createController($route);
     }
     return parent::createController("{$this->defaultRoute}/{$route}");
 }
开发者ID:ninazu,项目名称:yii2-mysql-migration,代码行数:17,代码来源:Module.php

示例3: createController

 public function createController($route)
 {
     if (strpos($route, 'admin/') !== false) {
         return $this->getModule('admin')->createController(str_replace('admin/', '', $route));
     } else {
         return parent::createController($route);
     }
 }
开发者ID:mirocow,项目名称:yii2-eav,代码行数:8,代码来源:Module.php

示例4: createController

 /**
  * Override createController()
  *
  * @link https://github.com/yiisoft/yii2/issues/810
  * @link http://www.yiiframework.com/forum/index.php/topic/21884-module-and-url-management/
  */
 public function createController($route)
 {
     preg_match('/(default)/', $route, $match);
     if (isset($match[0])) {
         return parent::createController($route);
     }
     $this->defaultRoute = !$this->defaultRoute || $this->defaultRoute == 'default' ? 'url' : $this->defaultRoute;
     if (sizeof(explode('/', $route)) > 1) {
         list($this->defaultRoute, $route) = explode('/', $route);
     }
     return parent::createController("{$this->defaultRoute}/{$route}");
 }
开发者ID:c006,项目名称:yii2-alias-url,代码行数:18,代码来源:Module.php

示例5: createController

 public function createController($route)
 {
     // check valid routes
     $validRoutes = [$this->defaultRoute, "admin", "album", "json"];
     $isValidRoute = false;
     foreach ($validRoutes as $validRoute) {
         if (strpos($route, $validRoute) === 0) {
             $isValidRoute = true;
             break;
         }
     }
     return (empty($route) or $isValidRoute) ? parent::createController($route) : parent::createController("{$this->defaultRoute}/{$route}");
 }
开发者ID:karczmarczyk,项目名称:photo-archive,代码行数:13,代码来源:Module.php

示例6: createController

 public function createController($route)
 {
     $this->normalizeController();
     return parent::createController($route);
 }
开发者ID:hscstudio,项目名称:yii2-heart,代码行数:5,代码来源:Module.php

示例7: createController

 /**
  * Modify createController() to handle routes in the default controller
  *
  * This is a temporary hack until they add in url management via modules
  * @link https://github.com/yiisoft/yii2/issues/810
  * @link http://www.yiiframework.com/forum/index.php/topic/21884-module-and-url-management/
  *
  * "usr" and "usr/default" work like normal
  * "usr/xxx" gets changed to "usr/default/xxx"
  *
  * @inheritdoc
  */
 public function createController($route)
 {
     if (\Yii::$app instanceof \yii\console\Application) {
         return parent::createController($route);
     }
     // check valid routes
     $validRoutes = [$this->defaultRoute, 'auth', 'manager'];
     $isValidRoute = false;
     foreach ($validRoutes as $validRoute) {
         if (strpos($route, $validRoute) === 0) {
             $isValidRoute = true;
             break;
         }
     }
     if (!empty($route) && !$isValidRoute) {
         $route = $this->defaultRoute . '/' . $route;
     }
     return parent::createController($route);
 }
开发者ID:rumatakira,项目名称:yii2-usr,代码行数:31,代码来源:Module.php

示例8: createController

 public function createController($route)
 {
     return parent::createController($this->realRoute ? $this->realRoute : $route);
 }
开发者ID:keyeMyria,项目名称:YetCMS,代码行数:4,代码来源:Module.php

示例9: createController

 public function createController($route)
 {
     return $this->beforeCreateController($route) ? parent::createController($route) : false;
 }
开发者ID:yinheark,项目名称:yincart2,代码行数:4,代码来源:Module.php

示例10: createController

 /**
  * Modify createController() to handle routes in the default controller
  *
  * This is a temporary hack until they add in url management via modules
  *
  * @link https://github.com/yiisoft/yii2/issues/810
  * @link http://www.yiiframework.com/forum/index.php/topic/21884-module-and-url-management/
  *
  * "user", "user/default", "user/admin", and "user/copy" work like normal
  * any other "user/xxx" gets changed to "user/default/xxx"
  *
  * @inheritdoc
  */
 public function createController($route)
 {
     // check valid routes
     $validRoutes = [$this->defaultRoute, "admin", "copy", "auth", "abonnement", 'company', "user-activities"];
     $isValidRoute = false;
     foreach ($validRoutes as $validRoute) {
         if (strpos($route, $validRoute) === 0) {
             $isValidRoute = true;
             break;
         }
     }
     return (empty($route) or $isValidRoute) ? parent::createController($route) : parent::createController("{$this->defaultRoute}/{$route}");
 }
开发者ID:jaccos,项目名称:wrkmtspr_prd,代码行数:26,代码来源:Module.php


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