src/Http/HttpCore.php
private function mapsController($controller, $uriapp = NULL, $method = NULL, $parentController = NULL){
        $httpMethod= isset($controller['httpMethod']) ? $controller['httpMethod'] : '*';
        if($parentController != NULL){
            $controller['url']= rtrim($parentController['url'], '/') . '/' . ltrim($controller['url'], '/');
        }
        $maps= UrlUri::mapsActualUrl($controller['url'], $uriapp) && UrlUri::mapsActualMethod($httpMethod, $method);
        if($maps){
            $mapController= array(
                'url' => $controller['url'],
                'httpMethod' => $httpMethod,
                'location' => isset($controller['location']) ? $controller['location'] : NULL,
                'namespace' => isset($controller['namespace']) ? $controller['namespace'] : NULL,
                'class' => isset($controller['class']) ? $controller['class'] : $parentController['class'],
                'method' => isset($controller['method']) ? $controller['method'] : NULL,
                'properties' => isset($controller['properties']) ? $controller['properties'] : array(),
                'middlewares' => isset($controller['middlewares']) ? $controller['middlewares'] : []
            );
            if($parentController != NULL){
                if(! isset($controller['class'])){
                    $mapController['location']= isset($parentController['location']) ? $parentController['location'] : NULL;
                    $mapController['namespace']= isset($parentController['namespace']) ? $parentController['namespace'] : NULL;
                }
                if(isset($parentController['properties'])){
                    $mapController['properties']= array_merge($parentController['properties'], $mapController['properties']);
                }
                if(isset($parentController['middlewares'])){
                    $mapController['middlewares'] = array_merge($parentController['middlewares'], $mapController['middlewares']);
                }
            }
            
            return $mapController;
        }else{
            return NULL;
        }
    }
private function mapsController($controller, $uriapp = NULL, $method = NULL, $parentController = NULL){
        $httpMethod= isset($controller['httpMethod']) ? $controller['httpMethod'] : '*';
        if($parentController != NULL){
            $controller['url']= rtrim($parentController['url'], '/') . '/' . ltrim($controller['url'], '/');
        }
        $maps= UrlUri::mapsActualUrl($controller['url'], $uriapp) && UrlUri::mapsActualMethod($httpMethod, $method);
        if($maps){
            $mapController= array(
                'url' => $controller['url'],
                'httpMethod' => $httpMethod,
                'location' => isset($controller['location']) ? $controller['location'] : NULL,
                'namespace' => isset($controller['namespace']) ? $controller['namespace'] : NULL,
                'class' => isset($controller['class']) ? $controller['class'] : $parentController['class'],
                'method' => isset($controller['method']) ? $controller['method'] : NULL,
                'properties' => isset($controller['properties']) ? $controller['properties'] : array(),
                'middlewares' => isset($controller['middlewares']) ? $controller['middlewares'] : []
            );
            if($parentController != NULL){
                if(! isset($controller['class'])){
                    $mapController['location']= isset($parentController['location']) ? $parentController['location'] : NULL;
                    $mapController['namespace']= isset($parentController['namespace']) ? $parentController['namespace'] : NULL;
                }
                if(isset($parentController['properties'])){
                    $mapController['properties']= array_merge($parentController['properties'], $mapController['properties']);
                }
                if(isset($parentController['middlewares'])){
                    $mapController['middlewares'] = array_merge($parentController['middlewares'], $mapController['middlewares']);
                }
            }
            
            return $mapController;
        }else{
            return NULL;
        }
    }
private function mapsController ( $ controller , $ uriapp = NULL , $ method = NULL , $ parentController = NULL ) { $ httpMethod = isset ( $ controller [ 'httpMethod' ] ) ? $ controller [ 'httpMethod' ] : '*' ; if ( $ parentController != NULL ) { $ controller [ 'url' ] = rtrim ( $ parentController [ 'url' ] , '/' ) . '/' . ltrim ( $ controller [ 'url' ] , '/' ) ; } $ maps = UrlUri :: mapsActualUrl ( $ controller [ 'url' ] , $ uriapp ) && UrlUri :: mapsActualMethod ( $ httpMethod , $ method ) ; if ( $ maps ) { $ mapController = array ( 'url' => $ controller [ 'url' ] , 'httpMethod' => $ httpMethod , 'location' => isset ( $ controller [ 'location' ] ) ? $ controller [ 'location' ] : NULL , 'namespace' => isset ( $ controller [ 'namespace' ] ) ? $ controller [ 'namespace' ] : NULL , 'class' => isset ( $ controller [ 'class' ] ) ? $ controller [ 'class' ] : $ parentController [ 'class' ] , 'method' => isset ( $ controller [ 'method' ] ) ? $ controller [ 'method' ] : NULL , 'properties' => isset ( $ controller [ 'properties' ] ) ? $ controller [ 'properties' ] : array ( ) , 'middlewares' => isset ( $ controller [ 'middlewares' ] ) ? $ controller [ 'middlewares' ] : [ ] ) ; if ( $ parentController != NULL ) { if ( ! isset ( $ controller [ 'class' ] ) ) { $ mapController [ 'location' ] = isset ( $ parentController [ 'location' ] ) ? $ parentController [ 'location' ] : NULL ; $ mapController [ 'namespace' ] = isset ( $ parentController [ 'namespace' ] ) ? $ parentController [ 'namespace' ] : NULL ; } if ( isset ( $ parentController [ 'properties' ] ) ) { $ mapController [ 'properties' ] = array_merge ( $ parentController [ 'properties' ] , $ mapController [ 'properties' ] ) ; } if ( isset ( $ parentController [ 'middlewares' ] ) ) { $ mapController [ 'middlewares' ] = array_merge ( $ parentController [ 'middlewares' ] , $ mapController [ 'middlewares' ] ) ; } } return $ mapController ; } else { return NULL ; } }
Controla si el controlador pasado mapea con la url y el metodo actual.
En caso de mapear arma la especificacion del controlador.
@param mixed $controller
@param string $uriapp
@param string $method
@param mixed $parentController
@return mixed
Controla si el controlador pasado mapea con la url y el metodo actual . En caso de mapear arma la especificacion del controlador .