public function createUrl( $route, $params = [ ], $absolute = FALSE )
    {
        $url = $this->script . '/' . $route;

        if ( file_exists( TEST_LOCK_FILE ) )
        {
            $url = $route;
        }

        if ( !empty( $params ) )
        {
            foreach ( $params as $value )
            {
                $url .= "/$value";
            }
        }

        if ( $absolute )
        {
            if ( !file_exists( TEST_LOCK_FILE ) )
            {
                $url = $this->scheme . '://' . $this->server . $url;
            }
            else
            {
                $url = BASE_URL . $url;
            }
        }

        return $url;
    }
public function createUrl( $route, $params = [ ], $absolute = FALSE )
    {
        $url = $this->script . '/' . $route;

        if ( file_exists( TEST_LOCK_FILE ) )
        {
            $url = $route;
        }

        if ( !empty( $params ) )
        {
            foreach ( $params as $value )
            {
                $url .= "/$value";
            }
        }

        if ( $absolute )
        {
            if ( !file_exists( TEST_LOCK_FILE ) )
            {
                $url = $this->scheme . '://' . $this->server . $url;
            }
            else
            {
                $url = BASE_URL . $url;
            }
        }

        return $url;
    }
public function createUrl ( $ route , $ params = [ ] , $ absolute = FALSE ) { $ url = $ this -> script . '/' . $ route ; if ( file_exists ( TEST_LOCK_FILE ) ) { $ url = $ route ; } if ( ! empty ( $ params ) ) { foreach ( $ params as $ value ) { $ url .= "/$value" ; } } if ( $ absolute ) { if ( ! file_exists ( TEST_LOCK_FILE ) ) { $ url = $ this -> scheme . '://' . $ this -> server . $ url ; } else { $ url = BASE_URL . $ url ; } } return $ url ; }
Creates a http url.

This method has a dependency on two defines
1. TEST_LOCK_FILE - test lock file, define it as '/path/to/site/root/test.lock'
2. BASE_URL - this is the base url of your application, e.g, http://rawphp.org

@param string $route    the route
@param array  $params   list of parameters (in the correct order)
@param bool   $absolute whether the url should be absolute

@return string the url
Creates a http url .