Commit 6992cc2c by Qiang Xue

Fixes #1196.

parent 42a58870
......@@ -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 [];
}
}
/**
......
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