auraphp / Aura.Input

Tools to describe HTML form fields and values.
MIT License
65 stars 11 forks source link

getValues #25

Closed harikt closed 11 years ago

harikt commented 11 years ago

I am mixing the packages, sorry. But consider

$data = $_POST;
$form->fill($data);
$form->filter();

In this case we get a filtered data of the fields, it have. But in many cases it will be like $_POST having more values. So I feel there is a need for $form->getValues() or something like that which we only get the values of the fields it have, removing the extra post values.

What do you think ?

pmjones commented 11 years ago

Implemented as getValue(), not getValues(), in https://github.com/auraphp/Aura.Input/commit/491f595a6781c598c30ae790bdb05386b5b2af49 .

I used getValue() instead of getValues() because we have to deal with both singular (Field) and plural (Fieldset, Collection). The method getValue() refers to the object-as-a-whole, not the sub-values in the object. If you can think of a better name that works with all three Field, Fieldset, and Collection (it does have to be the same) then let me know.

harikt commented 11 years ago

ok. Thanks!