Commit 6992cc2c by Qiang Xue

Fixes #1196.

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