phalcon/cphalcon — pull request #3076 by dugwood (2014-11-25 13:11:55+00:00)
Title: Fix default value for checkboxes/radios

Fix https://github.com/phalcon/cphalcon/issues/3058

- don't use the value from «default» if there's no value in params['value'] or _POST
- find out what the real default value is: use the _displayValues[] (setDefault function), or if it's not set, use the value from params['value'] or _POST
- once the real default value is found, just test it against the real current value

=> this should not break any script that didn't use the setDefault() function so far. But that will define what the «value» attribute should be: it doesn't depend on the field's value, as in «input type=text», it's a fixed value. If the value is the same as the default one, then the checked attribute is «checked».

I think the big issue there is that there's no difference between the value of the checkbox and the value of the parameter. For example, if I have to code it in PHP (don't mind the HTML injections!):
``
but:
`/>`
=> in the radio type, the value belongs to the input, not to the object ($value).