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