Skip to content

How to manage multiple form input parameter with same name? #69

@wildstray

Description

@wildstray

Hi, if I have a form with a single input for parameter, I can use:

if(request->hasParam("username", true)) {
    	username = request->getParam("username", true)->value();
}

but what if I a form with multiple input for the same parameter name? Eg.

<input type="text" name="username">
<input type="text" name="username">
<input type="text" name="username">

The browser send these parameters as an array... but if I use getParam()->value() I can read the fist one only. How to count and read all array parameters? Is this supported by the library?

Thank you! :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions