diff --git a/src/gii/model/Generator.php b/src/gii/model/Generator.php index 32800ee8a..e7ae44449 100644 --- a/src/gii/model/Generator.php +++ b/src/gii/model/Generator.php @@ -155,7 +155,7 @@ public function generate() $attributes = array_merge(['_id'], $customAttributes); } - $className = $this->generateClassName($collectionName); + $className = $this->modelClass ?: $this->generateClassName($collectionName); $params = [ 'collectionName' => $collectionName, 'className' => $className,