zendframework/zf2 — pull request #1989 by weierophinney (2012-07-25 18:23:40+00:00)
Title: Element values

Changeset created for @WalterTamboer on his suggestions

Element values may or may not be appropriate string values. As an
example, you may want to seed these as DateTime objects or other such
value objects -- which means that when it comes time to render them,
you may run into issues.

As such, I've added "getValue()" and "setValue()" to the
ElementInterface, and made Element proxy setAttribute('value', $value)
to set the element value. View helpers now will pull the value from the
element and add it to the attributes if it should be rendered.

This simplifies the CSRF element, as it can simply override getValue()
at this point. The DateTime element (and those deriving from it) can now
cast a DateTime object using a format (defaulting to RFC-3339, which is
what HTML5 expects). Checkboxes and radios now pull the value, not the
value attribute.