auraphp / Aura.Input

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

Need hasField #26

Closed harikt closed 11 years ago

harikt commented 11 years ago

It will be good to have hasField method for when we are adding a AntoCsrf class, if it is not authenticated the field __csrf_token will not be added and it will thow an exception

Uncaught exception 'Aura\Input\Exception\NoSuchInput' with message '__csrf_token'

harikt commented 11 years ago

The doc needs to be corrected for the way setField works. The second argument should be hidden and need to use setAttribs

harikt commented 11 years ago

I don't know whether it is a good idea not to throw the exception at all, if there is no field ? or whether hasField itself is good .

pmjones commented 11 years ago

This apparently exists already in the form of __isset($input_name).

rodsouto commented 7 years ago

Hi, __isset($input_name) checks if a value is set on an input (it returns false if a field exists but has no value set), I think we are missing a hasField() method, what do you think?