Get the controller name from a full qualified class name
@param $qualifiedControllerName
@return mixed
179568
public static function getControllerName($qualifiedControllerName)
    {
        $nsComponents = explode('\\', $qualifiedControllerName);
        $ctrlName = str_replace('Controller', '', end($nsComponents));

        return $ctrlName;
    }
300553
public function getControllerName()
    {
        if (null == $this->controllerName) {
            $this->controllerName = ucfirst($this->input->getArgument('controllerName'));
        }
        return $this->controllerName;
    }
573161
public function getControllerName()
    {
        if (empty($this->controller_name)) {
            $controller_class = get_class($this);

            if (($pos = strrpos($controller_class, '\\')) !== false) {
                $this->controller_name = substr($controller_class, $pos + 1);
            } else {
                $this->controller_name = $controller_class;
            }
        }

        return $this->controller_name;
    }
951363
public function getAppControllersMethod($methodName, $scope = '')
    {
        $methods = [];
        
        if ($this->appControllerRefls) {
            foreach ($this->appControllerRefls as $appRefl) {
                if ($appRefl->hasMethod($methodName)) {
                    $method = $appRefl->getMethod($methodName);
                    
                    if ($this->isApplicationController($method->getDeclaringClass()->getName())) {
                        if ($scope) {
                            $isScope = 'is' . ucfirst($scope);
                            if (!$method->$isScope()) {
                                continue;
                            }
                        }
                        $methods[] = $method->getClosure($this);
                    }
                }
            }
        }
        
        return $methods;
    }
1187933
protected function _getController()
    {
        if (!$this->_controller instanceof KControllerInterface) {
            $this->_controller = $this->getObject($this->_controller);
        }

        return $this->_controller;
    }
542230
function findControllerForView ($viewName)
  {
    /** @var DocumentContext $this */
    $path = $this->viewService->resolveTemplatePath ($viewName, $base);
//    inspect ($viewName, $base, $path);
    if (isset($this->controllers[$path]))
      return $this->controllers[$path];

    foreach ($this->controllerNamespaces as $nsPath => $ns) {
//      inspect ($nsPath, $ns);
      if (str_beginsWith ($path, $nsPath)) {
        $remaining = substr ($path, strlen ($nsPath) + 1);
        $a         = PS ($remaining)->split ('/');
        $file      = $a->pop ();
        $nsPrefix  = $a->map ('ucfirst', false)->join ('\\')->S;
        $class     = ($p = strpos ($file, '.')) !== false
          ? ucfirst (substr ($file, 0, $p))
          : ucfirst ($file);
        $FQN       = PA ([$ns, $nsPrefix, $class])->prune ()->join ('\\')->S;
//        inspect ("CLASS $FQN");
        if (class_exists ($FQN))
          return $FQN;
      }
    }
//    inspect ("CLASS NOT FOUND FOR VIEW $viewName");
    return null;
  }
1190592
public function getControllerShortName()
    {
        $relativeUrl = $this->request->getUri()->getPath();

        $rootUrl = parse_url(ROOT_URL);
        if (isset($rootUrl['path'])) {
            $rootUrlPath = $rootUrl['path'];
            $relativeUrl = str_replace(rtrim($rootUrlPath, '/'), '', $relativeUrl);
        }

        $parts = explode('/', trim($relativeUrl, '/'));
        if(count($parts) === 3){
            return $parts[1];
        }

        return null;
    }
1277313
protected function getControllerPrefix(ReflectionClass $controller)
    {
        preg_match("~\@prefix\s([a-zA-Z\\\_]+)~i", (string) $controller->getDocComment(), $prefix);
        return isset($prefix[1]) ? $prefix[1] : str_replace("controller", "", strtolower($controller->getShortName()));
    }
953826
public function getController()
    {
        if ($this->controller) {
            return $this->controller;
        }
        foreach (array_reverse(ClassInfo::ancestry($this->class)) as $blockClass) {
            $controllerClass = "{$blockClass}Controller";
            if (class_exists($controllerClass)) {
                break;
            }
        }
        if (!class_exists($controllerClass)) {
            throw new ValidationException("Could not find controller class for $this->classname");
        }

        $this->controller = Injector::inst()->create($controllerClass, $this);
        $this->controller->init();

        return $this->controller;
    }
757173
private function getControllerClassName() : string
    {
        $tableName = App::shortName(get_class($this->table), 'Model/Table', 'Table');

        return (string)App::className($tableName . 'Controller', 'Controller');
    }
590562
public function getController() {
        if(!empty($this->controller)) {
            return $this->controller;
        } else {
            preg_match('@(?:m[a-zA-Z0-9]{1,})_([a-zA-Z0-9]{1,})_(?:create)_([^/]+)_(?:table)@i', get_class($this), $matches);
            return $matches[2];
        }
    }
1074668
public function getGlobalType( $qualifiedName )
	{
		if ( isset( $this->schemaTypeCache[ $qualifiedName->__toString() ] ) )
		{
			return $this->schemaTypeCache[ $qualifiedName->__toString() ];
		}

		$schemaType = DOMSchemaType::fromSchemaType( $qualifiedName );
		return $schemaType;
	}
233382
public function controllerClassNameStrategy($name)
    {
        $names = explode('_', $name);
        $names = array_map('ucfirst', $names);
        return join('\\', $names) . 'Controller';
    }
1080820
public function getNameInput()
    {
        $name = Helpers::upperCaseEveyWord(trim($this->argument('controller-name')));
        $path = Config::getControllersPath();
        $directory = trim($this->option('controller-directory'));

        if (!empty($directory)) {
            $path .= Helpers::getPathWithSlash($directory);
        }

        return Helpers::convertSlashToBackslash($path . Helpers::postFixWith($name, Config::getControllerNamePostFix()));
    }
477110
public function getPageControllerTitle($name)
    {
        if (!array_key_exists($name, $this->config['page']['controllers'])) {
            throw new \InvalidArgumentException(sprintf('Undefined controller "%s".', $name));
        }

        return $this->config['page']['controllers'][$name]['title'];
    }
1122859
public function getController()
    {
        if (!is_null(self::$controller)) {
            return self::$controller;
        }
        $controllerParam = array_get($this->routeParams, 'controller');
        $match           = null;

        preg_match("'Foundation\\\Http\\\Controllers\\\(.*?)@'si", $controllerParam, $match);

        if (!isset($match[1]) && !preg_match("'Admin\\\(.*?)@'si", $controllerParam, $match)) {
            return;
        }
        self::$controller = str_replace('controller', '', strtolower($match[1]));
        return self::$controller;
    }
392840
public function getRequestedControllerName()
    {
        if (isset($this->_routingInfo['requested_controller'])) {
            return $this->_routingInfo['requested_controller'];
        }
        if (($this->_rewritedPathInfo !== null) && isset($this->_rewritedPathInfo[1])) {
            return $this->_rewritedPathInfo[1];
        }
        return $this->getControllerName();
    }