Browse Source

Fixes #1196.

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

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

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

Loading…
Cancel
Save