On Thu, 2 Aug 2007, Alexandru Stanoi wrote:

> The feature request tries to implement returning all the values for 
> param2 in an array.

The current (just committed) implemention now does the following:

        http://www.example.com/(param2)/a/(param2)/x/y
        $url->getParam( 'param2' ); // returns array( "a", "x", "y" );

And:
        $url->setParam( 'param2', array( 'x', 'y', 'w' ) );
        echo $url->buildUrl();
        // returns http://www.example.com/(param2)/a/(param2)/x/y/w


I would suggest changing this to the following behavior instead, because 
this makes things more flexible and you can actually update all parts 
correctly. For parsing, it should still only parse multiple vars 
"(param2)/a/b" when MULTIPLE_ARGUMENTS is set, and parse only 
"(param2)/c/d/(param2)/e/f" when AGGERATE_ARGUMENTS is set - I would 
have rename the option as nothing is really aggregated now.

The proposed workings:

        http://www.example.com/(param2)/a/(param2)/x/y
        $url->getParam( 'param2' ); // returns array( array( "a" ), array( "x", 
"y" ) );

And:
        $url->setParam( 'param2', array( array( 'b' ), array( 'x', 'y', 'w' ) ) 
);
        echo $url->buildUrl();
        // returns http://www.example.com/(param2)/b/(param2)/x/y/w

And:
        $url->setParam( 'param2', array( 'x', 'y', 'w' ) );
        echo $url->buildUrl();
        // returns http://www.example.com/(param2)/x/y/w
And:
        $url->setParam( 'param2', 'c' );
        echo $url->buildUrl();
        // returns http://www.example.com/(param2)/c


regards,
Derick
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to