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()
{
return [
'tableName' => function () {
return $this->getDbConnection()->getSchema()->getTableNames();
},
];
$db = $this->getDbConnection();
if ($db === null) {
return [
'tableName' => function () use ($db) {
return $db->getSchema()->getTableNames();
},
];
} else {
return [];
}
}
/**

Loading…
Cancel
Save