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


PHP Application::getModule方法代码示例

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


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

示例1: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     if ($app->hasModule('gii')) {
         if (!isset($app->getModule('gii')->generators['fixture-generator'])) {
             $app->getModule('gii')->generators['fixture-generator'] = ['class' => __NAMESPACE__ . '\\FixtureGenerator'];
         }
     }
 }
开发者ID:understeam,项目名称:yii2-fixture-generator,代码行数:12,代码来源:Bootstrap.php

示例2: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     if ($app->hasModule('gii')) {
         if (!isset($app->getModule('gii')->generators['migen'])) {
             $app->getModule('gii')->generators['migen'] = 'sirroland\\migen\\gii\\Generator';
         }
     }
 }
开发者ID:sirroland,项目名称:yii2-migen,代码行数:13,代码来源:Bootstrap.php

示例3: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     if ($app->hasModule('gii')) {
         if (!isset($app->getModule('gii')->generators['enhanced-gii'])) {
             $app->getModule('gii')->generators['enhanced-gii-model'] = 'mootensai\\enhancedgii\\model\\Generator';
             $app->getModule('gii')->generators['enhanced-gii-crud'] = 'mootensai\\enhancedgii\\crud\\Generator';
         }
     }
 }
开发者ID:marena,项目名称:yii2-enhanced-gii,代码行数:14,代码来源:Bootstrap.php

示例4: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     if ($app->hasModule('gii')) {
         $app->getModule('gii')->generators['giiant-model'] = 'pafnow\\giiant\\model\\Generator';
         $app->getModule('gii')->generators['giiant-crud'] = 'pafnow\\giiant\\crud\\Generator';
         if ($app instanceof \yii\console\Application) {
             $app->controllerMap['giiant-batch'] = 'pafnow\\giiant\\commands\\BatchController';
         }
     }
 }
开发者ID:pafnow,项目名称:yii2-giiant,代码行数:15,代码来源:Bootstrap.php

示例5: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     Yii::setAlias("@ajaxcrud", __DIR__);
     Yii::setAlias("@johnitvn/ajaxcrud", __DIR__);
     if ($app->hasModule('gii')) {
         if (!isset($app->getModule('gii')->generators['ajaxcrud'])) {
             $app->getModule('gii')->generators['ajaxcrud'] = 'johnitvn\\ajaxcrud\\generators\\Generator';
         }
     }
 }
开发者ID:keltstr,项目名称:yii2-ajaxcrud,代码行数:15,代码来源:Bootstrap.php

示例6: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     if ($app->hasModule('gii')) {
         if (!isset($app->getModule('gii')->generators['giiant-crud']['templates']['twig'])) {
             $app->getModule('gii')->generators['giiant-crud'] = ['class' => 'schmunk42\\giiant\\crud\\Generator', 'templates' => ['twig' => '@vendor/esquire900/yii2-giiant-twig/crud']];
         }
         if ($app instanceof \yii\console\Application) {
             $app->controllerMap['giiant-twig'] = 'esquire900\\giianttwig\\commands\\ConvertController';
         }
     }
 }
开发者ID:highestgoodlikewater,项目名称:yii2-giiant-twig,代码行数:16,代码来源:Bootstrap.php

示例7: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     if ($app->hasModule('gii')) {
         if (!isset($app->getModule('gii')->generators['giix-model'])) {
             $app->getModule('gii')->generators['giix-model'] = 'veyselsahin\\giix\\model\\Generator';
         }
         if (!isset($app->getModule('gii')->generators['giix-crud'])) {
             $app->getModule('gii')->generators['giix-crud'] = 'veyselsahin\\giix\\crud\\Generator';
         }
         if ($app instanceof \yii\console\Application) {
             $app->controllerMap['giix-batch'] = 'veyselsahin\\giix\\commands\\BatchController';
         }
     }
 }
开发者ID:veyselsahin,项目名称:yii2-giix,代码行数:19,代码来源:Bootstrap.php

示例8: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     //        \Yii::setAlias('@mtengii','@vendor/mootensai/yii2-enhanced-gii');
     if ($app->hasModule('gii')) {
         if (!isset($app->getModule('gii')->generators['enhanced-gii'])) {
             $app->getModule('gii')->generators['enhanced-gii-model'] = 'mootensai\\enhancedgii\\model\\Generator';
             $app->getModule('gii')->generators['enhanced-gii-crud']['class'] = 'mootensai\\enhancedgii\\crud\\Generator';
             //                $app->getModule('gii')->generators['enhanced-gii-crud']['templates'] = [
             //                    'default' => '@mtengii/crud/default',
             //                    'nested' => '@mtengii/crud/nested'
             //                ];
             $app->getModule('gii')->generators['enhanced-gii-migration'] = 'mootensai\\enhancedgii\\migration\\Generator';
         }
     }
 }
开发者ID:mootensai,项目名称:yii2-enhanced-gii,代码行数:20,代码来源:Bootstrap.php

示例9: registryGenerators

 /**
  * Rook gii templates
  *
  * @param Application $app the application currently running
  * @return array
  */
 public function registryGenerators($app)
 {
     $gii = $app->getModule('gii');
     if (!is_null($gii)) {
         $gii->generators = ArrayHelper::merge($gii->generators, ['model' => ['class' => \yii\gii\generators\model\Generator::class, 'templates' => ['skeleton' => '@skeleton/gii/generators/model/skeleton']], 'crud' => ['class' => \yii\gii\generators\crud\Generator::class, 'templates' => ['skeleton' => '@skeleton/gii/generators/crud/skeleton']], 'controller' => ['class' => \yii\gii\generators\controller\Generator::class, 'templates' => ['skeleton' => '@skeleton/gii/generators/controller/skeleton']], 'form' => ['class' => \yii\gii\generators\form\Generator::class, 'templates' => ['skeleton' => '@skeleton/gii/generators/form/skeleton']], 'module' => ['class' => \skeleton\gii\generators\module\Generator::class, 'templates' => ['skeleton' => '@skeleton/gii/generators/module/skeleton']], 'extension' => ['class' => \yii\gii\generators\extension\Generator::class, 'templates' => ['skeleton' => '@skeleton/gii/generators/extension/skeleton']]]);
     }
 }
开发者ID:itrook,项目名称:yii2-skeleton,代码行数:13,代码来源:Bootstrap.php

示例10: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     /** @var Module $module */
     /** @var \yii\db\ActiveRecord $modelName */
     if ($app->hasModule('activeuser') && ($module = $app->getModule('activeuser')) instanceof Module) {
         $this->_modelMap = array_merge($this->_modelMap, $module->modelMap);
         foreach ($this->_modelMap as $name => $definition) {
             $class = "inblank\\activeuser\\models\\" . $name;
             Yii::$container->set($class, $definition);
             $modelName = is_array($definition) ? $definition['class'] : $definition;
             $module->modelMap[$name] = $modelName;
         }
         if ($app instanceof ConsoleApplication) {
             $app->controllerMap['activeuser'] = ['class' => 'inblank\\activeuser\\commands\\DefaultController'];
         } else {
             // init user
             Yii::$container->set('yii\\web\\User', ['loginUrl' => ['/activeuser/account/login'], 'identityClass' => self::di('User')]);
             $configUrlRule = ['prefix' => $module->urlPrefix, 'rules' => defined('IS_BACKEND') ? $module->urlRulesBackend : $module->urlRulesFrontend];
             if ($module->urlPrefix != 'activeuser') {
                 $configUrlRule['routePrefix'] = 'activeuser';
             }
             $app->urlManager->addRules([new GroupUrlRule($configUrlRule)], false);
             if (defined('IS_BACKEND')) {
                 // is backend, and controller have other namespace
                 $module->controllerNamespace = 'inblank\\activeuser\\controllers\\backend';
                 $module->frontendUrlManager = new yii\web\UrlManager(['baseUrl' => '/', 'enablePrettyUrl' => true, 'showScriptName' => false]);
                 $configUrlRule['rules'] = $module->urlRulesFrontend;
                 $module->frontendUrlManager->addRules([new GroupUrlRule($configUrlRule)], false);
             }
         }
         if (!isset($app->get('i18n')->translations['activeuser*'])) {
             $app->get('i18n')->translations['activeuser*'] = ['class' => PhpMessageSource::className(), 'basePath' => __DIR__ . '/messages'];
         }
     }
 }
开发者ID:inblank,项目名称:yii2-activeuser,代码行数:39,代码来源:Bootstrap.php

示例11: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     /**
      * @var Module $gii
      */
     \Yii::setAlias('@carono', '@vendor/carono/yii2-components');
     if ($app instanceof \yii\console\Application) {
         $commands = ['city' => 'CityController', 'currency' => 'CurrencyController', 'dumper' => 'DumperController', 'carono' => 'CaronoController'];
         foreach ($commands as $name => $command) {
             $name = file_exists(\Yii::getAlias("@app/commands/{$command}.php")) ? "carono" . ucfirst($name) : $name;
             $app->controllerMap[$name] = 'carono\\components\\commands\\' . $command;
         }
         if (!isset($app->controllerMap['giix'])) {
             if (($gii = $app->getModule('gii')) && isset($gii->generators["giiant-model"])) {
                 if (!isset($gii->generators["giiant-model"]["templates"])) {
                     if (is_array($gii->generators["giiant-model"])) {
                         $gii->generators["giiant-model"]["templates"] = [];
                     } else {
                         $gii->generators["giiant-model"] = ["class" => 'schmunk42\\giiant\\generators\\model\\Generator', "templates" => []];
                     }
                 }
                 $template = '@vendor/carono/yii2-components/templates/giiant-model';
                 $gii->generators["giiant-model"]["templates"]["caronoModel"] = $template;
                 $app->controllerMap['giix'] = 'carono\\components\\commands\\GiixController';
             }
         }
     }
 }
开发者ID:carono,项目名称:yii2-components,代码行数:33,代码来源:Bootstrap.php

示例12: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     /**@var Module $gii */
     if ($app->hasModule('gii') && ($gii = $app->getModule('gii'))) {
         if (!isset($gii->generators['migration'])) {
             $gii->generators['migration'] = 'navatech\\migration\\gii\\Generator';
         }
     }
 }
开发者ID:navatech,项目名称:yii2-migration-generator,代码行数:14,代码来源:Bootstrap.php

示例13: getAuthItemsFromModules

 /**
  * @return array
  */
 protected function getAuthItemsFromModules()
 {
     $modules = $this->app->getModules();
     $authItems = [];
     foreach ($modules as $id => $config) {
         $module = $this->app->getModule($id);
         if (!$module instanceof Module) {
             continue;
         }
         $authItems = array_merge($authItems, $module->getAuthItems());
     }
     return $authItems;
 }
开发者ID:omnilight,项目名称:yz2-admin,代码行数:16,代码来源:AuthItemsFinder.php

示例14: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     if ($app->hasModule('gii')) {
         if (!isset($app->getModule('gii')->generators['giiant-model'])) {
             $app->getModule('gii')->generators['giiant-model'] = 'schmunk42\\giiant\\generators\\model\\Generator';
         }
         if (!isset($app->getModule('gii')->generators['giiant-extension'])) {
             $app->getModule('gii')->generators['giiant-extension'] = 'schmunk42\\giiant\\generators\\extension\\Generator';
         }
         if (!isset($app->getModule('gii')->generators['giiant-crud'])) {
             $app->getModule('gii')->generators['giiant-crud'] = ['class' => 'schmunk42\\giiant\\generators\\crud\\Generator', 'templates' => ['editable' => __DIR__ . '/generators/crud/editable']];
         }
         if (!isset($app->getModule('gii')->generators['giiant-module'])) {
             $app->getModule('gii')->generators['giiant-module'] = 'schmunk42\\giiant\\generators\\module\\Generator';
         }
         if (!isset($app->getModule('gii')->generators['giiant-test'])) {
             $app->getModule('gii')->generators['giiant-test'] = 'schmunk42\\giiant\\generators\\test\\Generator';
         }
         if ($app instanceof \yii\console\Application) {
             $app->controllerMap['giiant-batch'] = 'schmunk42\\giiant\\commands\\BatchController';
         }
     }
 }
开发者ID:schmunk42,项目名称:yii2-giiant,代码行数:28,代码来源:Bootstrap.php

示例15: bootstrap

 /**
  * Bootstrap method to be called during application bootstrap stage.
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     if ($app instanceof WebApplication) {
     }
     if ($app instanceof ConsoleApplication) {
         $app->controllerMap['module'] = ['class' => 'nullref\\core\\console\\ModuleController'];
         $app->controllerMap['modules-migrate'] = ['class' => 'nullref\\core\\console\\ModulesMigrateController'];
         $app->controllerMap['env'] = ['class' => 'nullref\\core\\console\\EnvController'];
         $app->getModule('core')->controllerMap['migrate'] = ['class' => 'nullref\\core\\console\\MigrateController'];
     }
     if (YII_ENV_DEV && class_exists('yii\\gii\\Module')) {
         Event::on(Gii::className(), Gii::EVENT_BEFORE_ACTION, function (Event $event) {
             /** @var Gii $gii */
             $gii = $event->sender;
             $gii->generators['relation-migration'] = ['class' => 'nullref\\core\\generators\\migration\\Generator'];
         });
     }
 }
开发者ID:NullRefExcep,项目名称:yii2-core,代码行数:22,代码来源:Bootstrap.php


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