public static function getClassNameByUrl($url){
        $class = null;
        if(!empty($url)){
            try{
                $route = new Resolver(new common_http_Request($url));
                $route->setServiceLocator(ServiceManager::getServiceManager());
                $class = $route->getControllerClass();
            } catch(\ResolverException $re){
                throw new common_exception_Error('The url "'.$url.'" could not be mapped to a controller : ' . $re->getMessage());
            }
        }
        if (is_null($class)) {
            throw new common_exception_Error('The url "'.$url.'" could not be mapped to a controller');
        }
        return $class;
    }
public static function getClassNameByUrl($url){
        $class = null;
        if(!empty($url)){
            try{
                $route = new Resolver(new common_http_Request($url));
                $route->setServiceLocator(ServiceManager::getServiceManager());
                $class = $route->getControllerClass();
            } catch(\ResolverException $re){
                throw new common_exception_Error('The url "'.$url.'" could not be mapped to a controller : ' . $re->getMessage());
            }
        }
        if (is_null($class)) {
            throw new common_exception_Error('The url "'.$url.'" could not be mapped to a controller');
        }
        return $class;
    }
public static function getClassNameByUrl ( $ url ) { $ class = null ; if ( ! empty ( $ url ) ) { try { $ route = new Resolver ( new common_http_Request ( $ url ) ) ; $ route -> setServiceLocator ( ServiceManager :: getServiceManager ( ) ) ; $ class = $ route -> getControllerClass ( ) ; } catch ( \ ResolverException $ re ) { throw new common_exception_Error ( 'The url "' . $ url . '" could not be mapped to a controller : ' . $ re -> getMessage ( ) ) ; } } if ( is_null ( $ class ) ) { throw new common_exception_Error ( 'The url "' . $ url . '" could not be mapped to a controller' ) ; } return $ class ; }
Helps you to get the name of the class for a given URL. The controller class name is used in privileges definition.
@param string $url
@throws \ResolverException
@return string the className
Helps you to get the name of the class for a given URL . The controller class name is used in privileges definition .