lib/Psc/URL/Helper.php
public static function getURL($section, $flags = 0x000000, Array $queryVars = array()) {
    /*
      Query Vars Handling
    */
    if ($section === NULL) {
      $url = $_SERVER['PHP_SELF']; // da bin ich mir hier noch nicht ganz sicher
      if (!isset($_SERVER['PHP_SELF'])) {
        throw new \Psc\Exception('SERVER[PHP_SELF] not set!');
      }
    } elseif ($section instanceof Routable) {
      /* Achtung hier return */
      return $section->getRoutingURL();
    } else {
      $url = $section;
    }
    
    if ($flags & self::ENV_QUERY_VARS) {
      $queryVars = (array) $_GET;
    } elseif($flags & self::MERGE_QUERY_VARS) {
      $queryVars = array_merge((array) $_GET, $queryVars);
    } elseif($flags & self::MY_QUERY_VARS) {
      $queryVars = (array) $queryVars;
    }
    $queryVars = array_filter($queryVars,create_function('$a', 'return $a != ""; '));
    
    if (count($queryVars) > 0) {
      if (mb_substr($url,-1) != '/' && mb_substr($url,-5) != '.html' && mb_substr($url,-4) != '.php')
        $url .= '/';

      $url .= '?';
      $url .= http_build_query($queryVars);
    }

    if ($flags & self::ABSOLUTE)
      $url = self::absolute($url);
      
    return $url;
  }
public static function getURL($section, $flags = 0x000000, Array $queryVars = array()) {
    /*
      Query Vars Handling
    */
    if ($section === NULL) {
      $url = $_SERVER['PHP_SELF']; // da bin ich mir hier noch nicht ganz sicher
      if (!isset($_SERVER['PHP_SELF'])) {
        throw new \Psc\Exception('SERVER[PHP_SELF] not set!');
      }
    } elseif ($section instanceof Routable) {
      /* Achtung hier return */
      return $section->getRoutingURL();
    } else {
      $url = $section;
    }
    
    if ($flags & self::ENV_QUERY_VARS) {
      $queryVars = (array) $_GET;
    } elseif($flags & self::MERGE_QUERY_VARS) {
      $queryVars = array_merge((array) $_GET, $queryVars);
    } elseif($flags & self::MY_QUERY_VARS) {
      $queryVars = (array) $queryVars;
    }
    $queryVars = array_filter($queryVars,create_function('$a', 'return $a != ""; '));
    
    if (count($queryVars) > 0) {
      if (mb_substr($url,-1) != '/' && mb_substr($url,-5) != '.html' && mb_substr($url,-4) != '.php')
        $url .= '/';

      $url .= '?';
      $url .= http_build_query($queryVars);
    }

    if ($flags & self::ABSOLUTE)
      $url = self::absolute($url);
      
    return $url;
  }
public static function getURL ( $ section , $ flags = 0x000000 , Array $ queryVars = array ( ) ) { /*
      Query Vars Handling
    */ if ( $ section === NULL ) { $ url = $ _SERVER [ 'PHP_SELF' ] ; // da bin ich mir hier noch nicht ganz sicher if ( ! isset ( $ _SERVER [ 'PHP_SELF' ] ) ) { throw new \ Psc \ Exception ( 'SERVER[PHP_SELF] not set!' ) ; } } elseif ( $ section instanceof Routable ) { /* Achtung hier return */ return $ section -> getRoutingURL ( ) ; } else { $ url = $ section ; } if ( $ flags & self :: ENV_QUERY_VARS ) { $ queryVars = ( array ) $ _GET ; } elseif ( $ flags & self :: MERGE_QUERY_VARS ) { $ queryVars = array_merge ( ( array ) $ _GET , $ queryVars ) ; } elseif ( $ flags & self :: MY_QUERY_VARS ) { $ queryVars = ( array ) $ queryVars ; } $ queryVars = array_filter ( $ queryVars , create_function ( '$a' , 'return $a != ""; ' ) ) ; if ( count ( $ queryVars ) > 0 ) { if ( mb_substr ( $ url , - 1 ) != '/' && mb_substr ( $ url , - 5 ) != '.html' && mb_substr ( $ url , - 4 ) != '.php' ) $ url .= '/' ; $ url .= '?' ; $ url .= http_build_query ( $ queryVars ) ; } if ( $ flags & self :: ABSOLUTE ) $ url = self :: absolute ( $ url ) ; return $ url ; }
Konstruiert eine URL

@param string|NULL|\Psc\URL\Routable $section wenn $section NULL ist, wird der Teil dynamisch bestimmt (aktuelle Seite)
Konstruiert eine URL