On Thu, Nov 5, 2009 at 11:23 PM, Fabio Mascarenhas <mascaren...@acm.org> wrote:
> On Thu, Nov 5, 2009 at 6:23 PM, Alexander Gladysh <aglad...@gmail.com>
> wrote:
>> 5. WSAPI handles duplicate request keys by putting all their values
>> into a table. I need to get more PHP-like behavior, when next value
>> for the duplicate key would override previous one. I had to copy and
>> change the request module to get this behavior. I do want a
>> configuration option.
>>
>
> Ok, this can be an option to wsapi.request.new:
> req = wsapi.request.new(wsapi_env, { overwrite = true })

This is how PHP works :

?var= is converted to a string value
?var[]= is converted to an array with integers for key
?var[foo]= is converted to an array with string for key
?var[foo][bar]=, ?var[foo][]=, ?var[foo][][bar]= also work, etc

So multiple selects are declared like this :
<select multiple="multiple" name="values[]">

It would be handy if wsapi could do something like that or allow to
use a specific callback that does it. So instead of { overwrite = true
}, you could pass your own function to parse the request args.

-- 
Bertrand Mansion
Mamasam

_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to