src/Vectorface/SnappyRouter/Handler/ControllerHandler.php
protected function extractPathFromBasePath($path, $options)
    {
        if (isset($options[self::KEY_BASE_PATH])) {
            $pos = strpos($path, $options[self::KEY_BASE_PATH]);
            if (false !== $pos) {
                $path = substr($path, $pos + strlen($options[self::KEY_BASE_PATH]));
            }
        }
        // ensure the path has a leading slash
        if (empty($path) || $path[0] !== '/') {
            $path = '/'.$path;
        }
        return $path;
    }
protected function extractPathFromBasePath($path, $options)
    {
        if (isset($options[self::KEY_BASE_PATH])) {
            $pos = strpos($path, $options[self::KEY_BASE_PATH]);
            if (false !== $pos) {
                $path = substr($path, $pos + strlen($options[self::KEY_BASE_PATH]));
            }
        }
        // ensure the path has a leading slash
        if (empty($path) || $path[0] !== '/') {
            $path = '/'.$path;
        }
        return $path;
    }
protected function extractPathFromBasePath ( $ path , $ options ) { if ( isset ( $ options [ self :: KEY_BASE_PATH ] ) ) { $ pos = strpos ( $ path , $ options [ self :: KEY_BASE_PATH ] ) ; if ( false !== $ pos ) { $ path = substr ( $ path , $ pos + strlen ( $ options [ self :: KEY_BASE_PATH ] ) ) ; } } // ensure the path has a leading slash if ( empty ( $ path ) || $ path [ 0 ] !== '/' ) { $ path = '/' . $ path ; } return $ path ; }
Returns the new path with the base path extracted.
@param string $path The full path.
@param array $options The array of options.
@return string Returns the new path with the base path removed.
Returns the new path with the base path extracted .