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


PHP Generator::init方法代码示例

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


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

示例1: init

 public function init()
 {
     parent::init();
     $this->baseModel = new BaseModelGenerator(['additionName' => 'Generator[baseModel]', 'createForm' => false, 'customBehaviors' => ['trans' => ['title' => 'Multilingual behavior', 'alias' => 'trans', 'checked' => true, 'languageField' => $this->languageField ?: 'language', 'langClassSuffix' => '', 'dynamicLangClass' => false, 'requireTranslations' => false, 'abridge' => false, 'langForeignKey' => '', 'attributesLang' => 'title, body, lang', 'langClassName' => '', 'languages' => null, 'class' => 'omgdef\\multilingual\\MultilingualBehavior']], 'addUseQuery' => 'use omgdef\\multilingual\\MultilingualTrait;' . PHP_EOL, 'addTraitsQuery' => 'use MultilingualTrait;' . PHP_EOL, 'translateGenerator' => true]);
     $this->translateModel = new BaseModelGenerator(['additionName' => 'Generator[translateModel]', 'createForm' => false]);
     $this->translateModel->tableBuilder->fields[] = new Field(['name' => $this->languageField, 'type' => Schema::TYPE_STRING, 'length' => 50, 'is_not_null' => true, 'comment' => 'Language']);
 }
开发者ID:infinitydevphp,项目名称:infinity-gii,代码行数:7,代码来源:Generator.php

示例2: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (Yii::getAlias('@common', false)) {
         $this->baseModelClass = 'common\\models\\base\\*Base';
     }
 }
开发者ID:ivan-chkv,项目名称:yii2-gii-plus,代码行数:10,代码来源:Generator.php

示例3: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // set $migrationName on init so that it can be loaded via $_POST later on preview and generation
     // if we don't set it, it will be different every time, and generator will give an error
     $this->migrationName = 'm' . gmdate('ymd_His') . '_create';
 }
开发者ID:sankam-nikolya,项目名称:yii2-gii-migartion,代码行数:10,代码来源:Generator.php

示例4: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (!isset($this->templates['adm'])) {
         $this->templates['adm'] = '@vendor/pavlinter/yii2-adm/adm/gii/generators/module/adm';
     }
     $this->templates['default'] = Yii::getAlias('@vendor/yiisoft/yii2-gii/generators/module/default');
     parent::init();
 }
开发者ID:richardcj,项目名称:yii2-adm,代码行数:11,代码来源:Generator.php

示例5: init

 public function init()
 {
     parent::init();
     $this->moduleDir = $this->getModuleDir();
     $this->modelClass = 'source\\modules\\' . $this->moduleDir . '\\models\\';
     $this->searchModelClass = 'source\\modules\\' . $this->moduleDir . '\\models\\search\\';
     $this->controllerClass = 'source\\modules\\' . $this->moduleDir . '\\admin\\controllers\\controller id Controller';
     $this->viewPath = '@source/modules/' . $this->moduleDir . '/admin/views/';
 }
开发者ID:hucongyang,项目名称:lulucms2,代码行数:9,代码来源:Generator.php

示例6: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (!isset($this->templates['adm'])) {
         $this->templates['adm'] = '@admgii/generators/crud/adm';
     }
     if (!isset($this->templates['frontend'])) {
         $this->templates['frontend'] = '@admgii/generators/crud/frontend';
     }
     $this->templates['default'] = Yii::getAlias('@vendor/yiisoft/yii2-gii/generators/crud/default');
     parent::init();
 }
开发者ID:pavlinter,项目名称:yii2-adm-app,代码行数:14,代码来源:Generator.php

示例7: init

    public function init()
    {
        $this->query = <<<PHP
/**
 * @var string \$modelClass
 */
\$query = \$modelClass::find();
\$query->limit(20)->offset(0);
return \$query;

PHP;
        parent::init();
    }
开发者ID:understeam,项目名称:yii2-fixture-generator,代码行数:13,代码来源:FixtureGenerator.php

示例8: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->ns = \Yii::$app->controllerNamespace;
 }
开发者ID:pathman,项目名称:yii2comm,代码行数:8,代码来源:Generator.php

示例9: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->migrationTime = gmdate('ymd_H0101');
 }
开发者ID:deesoft,项目名称:yii2-dev,代码行数:8,代码来源:Generator.php

示例10: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->path = Yii::getAlias('@app') . DIRECTORY_SEPARATOR . "models";
 }
开发者ID:phazei,项目名称:yii-eloquent-generator,代码行数:8,代码来源:Generator.php

示例11: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->templates['light.default'] = __DIR__ . '/default';
     parent::init();
 }
开发者ID:lichunqiang,项目名称:yii2-generators,代码行数:8,代码来源:Generator.php

示例12: Init

 public function Init()
 {
     parent::init();
     $dir = __DIR__ . '/../messages/';
     Yii::$app->i18n->translations[$this->messageCategory] = ['class' => 'yii\\i18n\\PhpMessageSource', 'sourceLanguage' => 'en-US', 'basePath' => $dir];
 }
开发者ID:infinitydevphp,项目名称:infinity-gii,代码行数:6,代码来源:Field.php


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