Commit 5474300c by Qiang Xue

fixed loading namespaceless controller classes.

parent 10061359
......@@ -687,7 +687,7 @@ class Module extends Component
$className = str_replace(' ', '', ucwords(str_replace('-', ' ', $className))) . 'Controller';
$classFile = $this->controllerPath . '/' . $prefix . $className . '.php';
$className = $this->controllerNamespace . '\\' . str_replace('/', '\\', $prefix) . $className;
$className = ltrim($this->controllerNamespace . '\\' . str_replace('/', '\\', $prefix) . $className, '\\');
if (strpos($className, '-') !== false || !is_file($classFile)) {
return null;
}
......
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