src/Routes/RouterAbstract.php
public function createController($path, $config = [], $defaultOnFault = true)
    {
        $path = trim($path, '/');
        $parts = explode('/', $path);
        if (count($parts) < 2) {
            if (!isset($parts[0]) || trim($parts[0]) === '') {
                return $defaultOnFault ? $this->getDefaultControllerAndAction($config) : [null, null];
            } else {
                $controllerName = mb_strtolower(array_pop($parts));
                $actionId = Controller::$_defaultAction;
            }
        } else {
            $actionId = mb_strtolower(array_pop($parts));
            $controllerName = mb_strtolower(array_pop($parts));
        }
        $controllerName = Inflector::id2camel($controllerName, '-') . 'Controller';
        if (!empty($parts)) {
            array_walk($parts, function(&$value) {
                $value = Inflector::id2camel($value, '-');
            });
            $controllerName = implode('\\', $parts) . '\\' . $controllerName;
        }
        list($controller, $actionId) = $this->createControllerInstance($controllerName, $actionId, $config);
        return $controller !== null
            ? [$controller, $actionId]
            : ($defaultOnFault ? $this->getDefaultControllerAndAction($config) : [null, null]);
    }
public function createController($path, $config = [], $defaultOnFault = true)
    {
        $path = trim($path, '/');
        $parts = explode('/', $path);
        if (count($parts) < 2) {
            if (!isset($parts[0]) || trim($parts[0]) === '') {
                return $defaultOnFault ? $this->getDefaultControllerAndAction($config) : [null, null];
            } else {
                $controllerName = mb_strtolower(array_pop($parts));
                $actionId = Controller::$_defaultAction;
            }
        } else {
            $actionId = mb_strtolower(array_pop($parts));
            $controllerName = mb_strtolower(array_pop($parts));
        }
        $controllerName = Inflector::id2camel($controllerName, '-') . 'Controller';
        if (!empty($parts)) {
            array_walk($parts, function(&$value) {
                $value = Inflector::id2camel($value, '-');
            });
            $controllerName = implode('\\', $parts) . '\\' . $controllerName;
        }
        list($controller, $actionId) = $this->createControllerInstance($controllerName, $actionId, $config);
        return $controller !== null
            ? [$controller, $actionId]
            : ($defaultOnFault ? $this->getDefaultControllerAndAction($config) : [null, null]);
    }
Get controller and action from path (Just parse path)
@param string $path
@param array  $config
@param bool   $defaultOnFault
@return array