ElevatoDigital/dewdrop

Allow Custom Attributes on Input Elements (via View Helper)

Opened this issue · 0 comments

Use Case

I would like to:

  1. Show a disabled input field on a form, automatically setting the value for the user. The user should still see the value but not be able to edit it.
  2. Set any number of custom HTML5 data attributes on an element.

Issue
Current input view helpers, which render individual form elements, do not allow for setting custom attributes on the element.

See:
https://github.com/DeltaSystems/dewdrop/blob/196c00161027ecf122fc78ed4b32a9af856896c9/Dewdrop/View/Helper/InputText.php#L107

Proposed Solution
Allow users to set attributes as needed. Whether it be data attributes, disabled flag, or otherwise.