public function init()
 {
     parent::init();
     if (Yii::$app instanceof \yii\web\Application) {
         Yii::$app->controller->layout = '@coksnuss/gii/modelgen/views/layouts/generator';
     }
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (Yii::getAlias('@common', false)) {
         $this->ns = 'common\\models\\base';
     }
 }
 public function init()
 {
     parent::init();
     if (isset(Yii::$app->params['hii-model'])) {
         foreach (Yii::$app->params['hii-model'] as $key => $value) {
             $this->{$key} = $value;
         }
     }
 }
Exemple #4
0
 /**
  * Inits generator
  */
 public function init()
 {
     if (!isset($this->templates[self::TMPL_NAME])) {
         $this->templates[self::TMPL_NAME] = $this->extendedTemplate();
     }
     $this->staticNs = Yii::$app->getModule('gii')->namespaces;
     if (!empty($this->staticNs) && !is_array($this->staticNs)) {
         throw new \yii\base\ErrorException('Gii Model Namespaces should be array');
     }
     return parent::init();
 }
 public function init()
 {
     parent::init();
     $this->tableBuilder = new TableGenerator(['tableNameRequired' => false, 'useTablePrefix' => $this->useTablePrefix]);
     $behaviorsConfig = array_merge($this->predefineBehaviors(), $this->customBehaviors);
     $this->buildBehaviors($behaviorsConfig);
 }
Exemple #6
0
 /**
  * Inits generator
  */
 public function init()
 {
     if (!isset($this->templates[self::ID_CURRENT_TMPL])) {
         $this->templates[self::ID_CURRENT_TMPL] = $this->tmplsRootDir();
     }
     $this->namespaces = Yii::$app->getModule('gii')->namespaces;
     if (!empty($this->namespaces) && !is_array($this->namespaces)) {
         throw new \yii\base\ErrorException('Giier namespaces should be array');
     }
     $translations = Yii::$app->getModule('gii')->translations;
     if ($translations) {
         $this->translations = $translations;
     }
     $modules = Yii::$app->getModule('gii')->modules;
     if ($modules) {
         $this->modules = $modules;
     }
     $messages = Yii::$app->getModule('gii')->messages;
     if ($messages) {
         $this->messages = $messages;
     }
     $bases = Yii::$app->getModule('gii')->bases;
     if ($bases) {
         $this->bases = $bases;
     }
     $relAliases = Yii::$app->getModule('gii')->relAliases;
     if ($relAliases) {
         $this->relAliases = $relAliases;
     }
     $this->namespaces = Yii::$app->getModule('gii')->namespaces;
     $this->generateQuery = true;
     $this->generateRelations = self::RELATIONS_ALL_INVERSE;
     $this->enableI18N = true;
     $this->template = self::ID_CURRENT_TMPL;
     $this->messageCategory = null;
     $this->queryNs = null;
     $this->helperCrud = new helpers\CrudHelper($this);
     $this->helperModel = new ModelHelper($this);
     $this->helperComponent = new helpers\ComponentHelper($this);
     return parent::init();
 }