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;
    }
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;
    }
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 ; }
Get the controller short name as used into the URL
@return string the name
@throws \ResolverException
Get the controller short name as used into the URL