Commit 1e7a359c by Qiang Xue

Merge pull request #1853 from creocoder/gii-table-prefix-fix

gii additional table prefix fixes
parents 4bee9e84 cdfbcd92
......@@ -550,13 +550,8 @@ class Generator extends \yii\gii\Generator
}
$patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/';
}
if (!empty($db->tablePrefix)) {
$patterns[] = "/^{$db->tablePrefix}(.*?)$/";
$patterns[] = "/^(.*?){$db->tablePrefix}$/";
} else {
$patterns[] = "/^tbl_(.*?)$/";
}
$patterns[] = "/^{$db->tablePrefix}(.*?)$/";
$patterns[] = "/^(.*?){$db->tablePrefix}$/";
$className = $tableName;
foreach ($patterns as $pattern) {
if (preg_match($pattern, $tableName, $matches)) {
......
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