Skip to content

Commit 7f129c1

Browse files
Fix #485: Add validation rules for enableI18N and messageCategory to Generator
1 parent aceea1b commit 7f129c1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Yii Framework 2 gii extension Change Log
66

77
- Bug #467: Fix view `generators/crud/default/controller` (WinterSilence, cjrf)
88
- Bug #476: Fix stucking datalist options in form generator (WinterSilence)
9+
- Enh #485: Add validation rules for `enableI18N` and `messageCategory` to Generator (WinterSilence)
910
- Bug #484: Add parent's labels and hints, fix rule for attribute `moduleClass` in module generator (WinterSilence)
1011
- Bug #486: Update `assets/js/bs4-native.min.js` to latest version (WinterSilence)
1112
- Bug #488: Fix `ActionColumn::$urlCreator` in index template of CRUD generator (WinterSilence)

src/Generator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function getDescription()
201201
* Child classes should override this method like the following so that the parent
202202
* rules are included:
203203
*
204-
* ~~~
204+
* ~~~php
205205
* return array_merge(parent::rules(), [
206206
* ...rules for the child class...
207207
* ]);
@@ -212,6 +212,8 @@ public function rules()
212212
return [
213213
[['template'], 'required', 'message' => 'A code template must be selected.'],
214214
[['template'], 'validateTemplate'],
215+
[['enableI18N'], 'boolean'],
216+
[['messageCategory'], 'string'],
215217
];
216218
}
217219

0 commit comments

Comments
 (0)