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']); }
/** * @inheritdoc */ public function init() { parent::init(); if (Yii::getAlias('@common', false)) { $this->baseModelClass = 'common\\models\\base\\*Base'; } }
/** * @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'; }
public function init() { parent::init(); $this->baseModel = new BaseModelGenerator(['additionName' => 'Generator[baseModel]', 'createForm' => false]); $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']); }
public function init() { if (!sizeof($this->fields)) { $this->fields = [new Field(['name' => $this->primaryKeyName, 'type' => Schema::TYPE_PK, 'is_not_null' => true, 'comment' => 'ID']), new Field(['name' => 'status', 'type' => Schema::TYPE_SMALLINT, 'default' => 1, 'is_not_null' => true, 'comment' => 'Status'])]; } $this->tablesList = Yii::$app->db->schema->tableNames; parent::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(); }
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/'; }
/** * @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(); }
public function init() { $this->query = <<<PHP /** * @var string \$modelClass */ \$query = \$modelClass::find(); \$query->limit(20)->offset(0); return \$query; PHP; parent::init(); }
public function init() { parent::init(); }
/** * @inheritdoc */ public function init() { parent::init(); $this->ns = \Yii::$app->controllerNamespace; }
/** * @inheritdoc */ public function init() { parent::init(); $this->migrationTime = gmdate('ymd_H0101'); }
/** * @inheritdoc */ public function init() { parent::init(); $this->path = Yii::getAlias('@app') . DIRECTORY_SEPARATOR . "models"; }
/** * @inheritdoc */ public function init() { $this->templates['light.default'] = __DIR__ . '/default'; parent::init(); }
public function init() { parent::init(); $this->moduleDir = $this->getModuleDir(); $this->ns = 'source\\modules\\' . $this->moduleDir . '\\models'; }
public function Init() { parent::init(); $dir = __DIR__ . '/../messages/'; Yii::$app->i18n->translations[$this->messageCategory] = ['class' => 'yii\\i18n\\PhpMessageSource', 'sourceLanguage' => 'en-US', 'basePath' => $dir]; }
/** * @inheritdoc */ public function init() { $this->templates['light.form.panel'] = __DIR__ . '/bootstrap'; $this->templates['light.form.ajax'] = __DIR__ . '/ajax'; parent::init(); }