Commit 935ab042 by Qiang Xue

Merge pull request #3811 from mitalcoi/master

add autocomplete for model class field
parents 281b71aa 4f57fdb5
......@@ -4,6 +4,7 @@ Yii Framework 2 gii extension Change Log
2.0.0-rc under development
--------------------------
- Enh #3811: Now Gii model generator makes autocomplete for model class field (mitalcoi)
- Bug #1263: Fixed the issue that Gii and Debug modules might be affected by incompatible asset manager configuration (qiangxue)
- Bug #2314: Gii model generator does not generate correct relation type in some special case (qiangxue)
- Bug #3265: Fixed incorrect controller class name validation (suralc)
......
......@@ -151,6 +151,19 @@ yii.gii = (function ($) {
$('#model-generator .field-generator-modelclass').toggle($(this).val().indexOf('*') == -1);
}).change();
//model generator: translate table name to model class
$('#generator-tablename').on('blur', function () {
var tableName = $(this).val();
if ($('#generator-modelclass').val()=='' && tableName && tableName.indexOf('*') === -1){
var modelClass='';
$.each(tableName.split('_'), function() {
if(this.length>0)
modelClass+=this.substring(0,1).toUpperCase()+this.substring(1);
});
$('#generator-modelclass').val(modelClass);
}
});
// hide message category when I18N is disabled
$('form #generator-enablei18n').change(function () {
$('form .field-generator-messagecategory').toggle($(this).is(':checked'));
......
......@@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.0-rc under development
--------------------------
- Enh #3811: Now Gii model generator makes autocomplete for model class field (mitalcoi)
- Bug #1263: Fixed the issue that Gii and Debug modules might be affected by incompatible asset manager configuration (qiangxue)
- Bug #2314: Gii model generator does not generate correct relation type in some special case (qiangxue)
- Bug #2563: Theming is not working if the path map of the theme contains ".." or "." in the paths (qiangxue)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment