public static function fromString($url, Url $root = null)
    {
        $instance = new static();
        $components = static::parseUrl($url);
        foreach ($components as $component => $value) {
            $method = 'set' . Inflector::camelize($component);
            call_user_func(array($instance, $method), $value);
        }
        $instance->setOriginal($url);
        $instance->setRoot($root);

        return $instance;
    }
public static function fromString($url, Url $root = null)
    {
        $instance = new static();
        $components = static::parseUrl($url);
        foreach ($components as $component => $value) {
            $method = 'set' . Inflector::camelize($component);
            call_user_func(array($instance, $method), $value);
        }
        $instance->setOriginal($url);
        $instance->setRoot($root);

        return $instance;
    }
public static function fromString ( $ url , Url $ root = null ) { $ instance = new static ( ) ; $ components = static :: parseUrl ( $ url ) ; foreach ( $ components as $ component => $ value ) { $ method = 'set' . Inflector :: camelize ( $ component ) ; call_user_func ( array ( $ instance , $ method ) , $ value ) ; } $ instance -> setOriginal ( $ url ) ; $ instance -> setRoot ( $ root ) ; return $ instance ; }
Construye una instancia a partir de un objeto con una interfaz similar.
@param string $url
@param Url $root NULL por defecto.
Construye una instancia a partir de un objeto con una interfaz similar .