protected static function flatten( $routes, $param_prefix = '' ) 
	{
		
		$flattened = array();
		
		foreach( $routes as $prefix => $route ) 
		{
			if ( is_array( $route ) && !is_callable( $route ) ) 
			{
				$flattened = array_merge( static::flatten( $route, $param_prefix.$prefix.'/' ), $flattened );
			} 
			else 
			{
				if ( $prefix == '/' ) 
				{
					$prefix = ''; $param_prefix = substr( $param_prefix, 0, -1 );
					$flattened[$param_prefix.$prefix] = $route;
					$param_prefix.= '/';
				} 
				else 
				{
					$flattened[$param_prefix.$prefix] = $route;
				}
			}
		}
		
		return $flattened;
	}
protected static function flatten( $routes, $param_prefix = '' ) 
	{
		
		$flattened = array();
		
		foreach( $routes as $prefix => $route ) 
		{
			if ( is_array( $route ) && !is_callable( $route ) ) 
			{
				$flattened = array_merge( static::flatten( $route, $param_prefix.$prefix.'/' ), $flattened );
			} 
			else 
			{
				if ( $prefix == '/' ) 
				{
					$prefix = ''; $param_prefix = substr( $param_prefix, 0, -1 );
					$flattened[$param_prefix.$prefix] = $route;
					$param_prefix.= '/';
				} 
				else 
				{
					$flattened[$param_prefix.$prefix] = $route;
				}
			}
		}
		
		return $flattened;
	}
protected static function flatten ( $ routes , $ param_prefix = '' ) { $ flattened = array ( ) ; foreach ( $ routes as $ prefix => $ route ) { if ( is_array ( $ route ) && ! is_callable ( $ route ) ) { $ flattened = array_merge ( static :: flatten ( $ route , $ param_prefix . $ prefix . '/' ) , $ flattened ) ; } else { if ( $ prefix == '/' ) { $ prefix = '' ; $ param_prefix = substr ( $ param_prefix , 0 , - 1 ) ; $ flattened [ $ param_prefix . $ prefix ] = $ route ; $ param_prefix .= '/' ; } else { $ flattened [ $ param_prefix . $ prefix ] = $ route ; } } } return $ flattened ; }
Flatten the routes

@param array		$routes
@param string		$param_prefix
@return array
Flatten the routes