Returns the subpackage key of the specified controller.
If there is no subpackage key set, the method returns NULL.

@return string The subpackage key
@api
3118
public function getControllerSubpackageKey()
    {
        $controllerObjectName = $this->getControllerObjectName();
        if ($this->controllerSubpackageKey !== null && $controllerObjectName !== '') {

            // Extract the subpackage key from the controller object name to assure that the case is correct.
            return substr($controllerObjectName, strlen($this->controllerPackageKey) + 1, strlen($this->controllerSubpackageKey));
        } else {
            return $this->controllerSubpackageKey;
        }
    }
630271
final protected function getPagesControllerClassName()
    {
        $modules = modules()->getArrayCopy();

        foreach($modules as $module) {
            $controllerClassName = $module->getNamespace() . 'Controllers\Pages';
            if ($module->getNamespace() === 'O2System\Framework\\') {
                $controllerClassName = 'O2System\Framework\Http\Controllers\Pages';
            }

            if(class_exists($controllerClassName)) {
                return $controllerClassName;
                break;
            }
        }

        if(class_exists('O2System\Framework\Http\Controllers\Pages')) {
            return 'O2System\Framework\Http\Controllers\Pages';
        }

        return false;
    }
4031
public function getSubtableDimension()
    {
        if (empty($this->actionToLoadSubTables)) {
            return null;
        }

        list($subtableReportModule, $subtableReportAction) = $this->getSubtableApiMethod();

        $subtableReport = ReportsProvider::factory($subtableReportModule, $subtableReportAction);
        if (empty($subtableReport)) {
            return null;
        }

        return $subtableReport->getDimension();
    }
834051
protected function getCacheKey()
	{
		if($this->_key!==null)
			return $this->_key;
		else
		{
			$key=$this->getBaseCacheKey().'.';
			if($this->varyByRoute)
			{
				$controller=$this->getController();
				$key.=$controller->getUniqueId().'/';
				if(($action=$controller->getAction())!==null)
					$key.=$action->getId();
			}
			$key.='.';

			if($this->varyBySession)
				$key.=Yii::app()->getSession()->getSessionID();
			$key.='.';

			if(is_array($this->varyByParam) && isset($this->varyByParam[0]))
			{
				$params=array();
				foreach($this->varyByParam as $name)
				{
					if(isset($_GET[$name]))
						$params[$name]=$_GET[$name];
					else
						$params[$name]='';
				}
				$key.=serialize($params);
			}
			$key.='.';

			if($this->varyByExpression!==null)
				$key.=$this->evaluateExpression($this->varyByExpression);
			$key.='.';

			if($this->varyByLanguage)
				$key.=Yii::app()->language;
			$key.='.';

			return $this->_key=$key;
		}
	}
1014302
public function getLanguageKey()
    {
        $languageKey = 'unknown';

        if ($this->environmentService->isEnvironmentInFrontendMode()) {
            $pageController = Core::get()->getPageController();

            if (isset($pageController->config['config']['language'])) {
                $languageKey = $pageController->config['config']['language'];
            }
        } else {
            $backendUser = Core::get()->getBackendUser();

            if (strlen($backendUser->uc['lang']) > 0) {
                $languageKey = $backendUser->uc['lang'];
            }
        }

        return $languageKey;
    }
499352
public function getPackageName(): string
    {
        $this->findPackage();

        if (!isset($this->package->name)) {
            return '';
        }

        return $this->package->name;
    }
1057504
protected function getBundleName()
    {
        $pattern = "/(.*)Bundle/";
        $matches = array();
        preg_match($pattern, $this->getRequest()->get('_controller'), $matches);
        return empty($matches) ? null : $matches[1];
    }
1093809
public function getActionKey()
    {
        if ($this->receiver !== null) {
            if ($this->role->getWorkspace() === null) {
                return $this::ACTION_USER;
            } else {
                return $this::ACTION_WORKSPACE_USER;
            }
        } else {
            if ($this->role->getWorkspace() === null) {
                return $this::ACTION_GROUP;
            } else {
                return $this::ACTION_WORKSPACE_GROUP;
            }
        }
    }
1351529
protected function getControllerContent()
    {
        if (!$stub = $this->getControllerStub()) {
            return '';
        }

        $sectionSegmentsStudly = $this->sectionSegmentsStudly;

        $name      = array_pop($sectionSegmentsStudly).'Controller';
        $namespace = $this->appNs.'\Http\Controllers';
        $requestNs = $this->appNs.'\Http\Requests\\'.implode('\\', $this->sectionSegmentsStudly);
        $listingClass = $this->appNs.'\Listings\\'.implode('\\', $this->sectionSegmentsStudly).'Listing';

        if ($sectionSegmentsStudly) {
            $namespace .= '\\'.implode('\\', $sectionSegmentsStudly);
        }

        return strtr($stub, array_merge($this->getCommonReplacements(), [
            '{{namespace}}'        => $namespace,
            '{{name}}'             => $name,
            '{{requestNamespace}}' => $requestNs,
            '{{listingClass}}'     => $listingClass,
        ]));
    }
566196
public function getFilterKey($action = null)
    {
        // controller.action
        $controller = $this->getName();
        return $action ? $controller . '.' . $action : $controller;
    }
487943
public function getControllerObjectName()
    {
        $possibleObjectName = '@package\@subpackage\Controller\@controllerController';
        $possibleObjectName = str_replace('@package', str_replace('.', '\\', $this->controllerPackageKey), $possibleObjectName);
        $possibleObjectName = str_replace('@subpackage', $this->controllerSubpackageKey, $possibleObjectName);
        $possibleObjectName = str_replace('@controller', $this->controllerName, $possibleObjectName);
        $possibleObjectName = str_replace('\\\\', '\\', $possibleObjectName);

        $controllerObjectName = $this->objectManager->getCaseSensitiveObjectName($possibleObjectName);
        return ($controllerObjectName !== false) ? $controllerObjectName : '';
    }
1241317
public static String getControllerName() {
		Map<String, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
		if (sessionMap.containsKey(DART_CONTROLLER_NAME)) {
			return (String) sessionMap.get(DART_CONTROLLER_NAME);
		}
		return null;
	}
579684
protected function fetchSubTemplateName()
    {
        if (!empty($this->subTemplate)) return;

        $className = get_called_class();

        if (mb_strpos($className, 'Controllers') === false)
        {
            $this->system->log()->notice("Fully qualified Controller class name does not contain 'Controllers' so we can't automatically discern the sub template name.");
            return;
        }

        $classSegments = explode('\\', $className);

        $templateName = '';
        while (($segment = array_pop($classSegments)) !== 'Controllers')
        {
            if (empty($templateName))
            {
                $templateName = strtolower($segment) . '.php';
            }
            else
            {
                $templateName = strtolower($segment) . DIRECTORY_SEPARATOR . $templateName;
            }
        }

        $this->subTemplate = 'pages' . DIRECTORY_SEPARATOR . $templateName;
    }
1196409
public function getSPkey()
    {
        $key = null;
        if (isset($this->_sp['privateKey']) && !empty($this->_sp['privateKey'])) {
            $key = $this->_sp['privateKey'];
        } else {
            $keyFile = $this->_paths['cert'].'sp.key';

            if (file_exists($keyFile)) {
                $key = file_get_contents($keyFile);
            }
        }
        return $key;
    }
982637
public function getName(): string
	{
		if( !$this->name )
		{
			$name = $this->getModule()->getKey();
			if( preg_match('/Controllers\\\\(.*?)$/', static::class, $e ) )
			{
				$name .= '::' . preg_replace_callback( '/[A-Z]/', static function( $m ) { return '_' . lcfirst( $m[0] ); }, lcfirst( $e[1] ) );
				$name  = str_replace( '\\', ':', $name );
			}
			$this->name = strtolower( $name );
		}

		return $this->name;
	}
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;
    }
972292
public function key()
    {
        return isset( $this->packageNames[$this->index] )
            ? $this->packageNames[$this->index]
            : null;
    }