From 2765bcccf8e5f9918a605423982f7889327e18ff Mon Sep 17 00:00:00 2001 From: Niko Wicaksono Date: Sun, 22 Sep 2013 00:49:12 +0700 Subject: [PATCH] Use str_replace() rather than implode-explode --- framework/yii/base/Module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/base/Module.php b/framework/yii/base/Module.php index a85385b..9b98a3c 100644 --- a/framework/yii/base/Module.php +++ b/framework/yii/base/Module.php @@ -615,7 +615,7 @@ abstract class Module extends Component if (isset($this->controllerMap[$id])) { $controller = Yii::createObject($this->controllerMap[$id], $id, $this); } elseif (preg_match('/^[a-z0-9\\-_]+$/', $id)) { - $className = str_replace(' ', '', ucwords(implode(' ', explode('-', $id)))) . 'Controller'; + $className = str_replace(' ', '', ucwords(str_replace('-', ' ', $id))) . 'Controller'; $classFile = $this->controllerPath . DIRECTORY_SEPARATOR . $className . '.php'; if (!is_file($classFile)) { return false;