Browse Source

Fixes #1196.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
6992cc2c73
  1. 15
      extensions/gii/generators/model/Generator.php

15
extensions/gii/generators/model/Generator.php

@ -115,11 +115,16 @@ class Generator extends \yii\gii\Generator
*/ */
public function autoCompleteData() public function autoCompleteData()
{ {
return [ $db = $this->getDbConnection();
'tableName' => function () { if ($db === null) {
return $this->getDbConnection()->getSchema()->getTableNames(); return [
}, 'tableName' => function () use ($db) {
]; return $db->getSchema()->getTableNames();
},
];
} else {
return [];
}
} }
/** /**

Loading…
Cancel
Save