You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When $db->tablePrefix is empty, this results in an array containing three patterns of which the first two would both be /^(.*?)$/ and the third /^prefix_(\w+)$/. Since patterns are matched in the order in which they appear in the array, the prefix pattern would never match.
Solution would be to check if $db->tablePrefix is empty and not set or change the order of the patterns.
The text was updated successfully, but these errors were encountered:
What steps will reproduce the problem?
db
Connection does not havetablePrefix
set.prefix_some_model
,prefix_another_model
./yii gii/model --tableName=prefix_*
What's expected?
Two new classes, named: SomeModel and AnotherModel
What do you get instead?
Two new classes, named PrefixSomeModel and PrefixAnotherModel
Additional info
yii\gii\generators\model\Generator::generateClassName()
generates classnames by matching the following patterns:When $db->tablePrefix is empty, this results in an array containing three patterns of which the first two would both be
/^(.*?)$/
and the third/^prefix_(\w+)$/
. Since patterns are matched in the order in which they appear in the array, the prefix pattern would never match.Solution would be to check if
$db->tablePrefix
is empty and not set or change the order of the patterns.The text was updated successfully, but these errors were encountered: