Browse Source

better validation of module in gii module generator

fixes #963
tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
982b7fe4ae
  1. 3
      framework/yii/gii/generators/module/Generator.php

3
framework/yii/gii/generators/module/Generator.php

@ -147,6 +147,9 @@ EOD;
if (strpos($this->moduleClass, '\\') === false || Yii::getAlias('@' . str_replace('\\', '/', $this->moduleClass)) === false) {
$this->addError('moduleClass', 'Module class must be properly namespaced.');
}
if (substr($this->moduleClass, -1, 1) == '\\') {
$this->addError('moduleClass', 'Module class name must not be empty. Please enter a fully qualified class name. e.g. "app\\modules\\admin\\Module".');
}
}
/**

Loading…
Cancel
Save