Closed Brindster closed 6 years ago
@Brindster
This pull request adds the ability to add additional valid attributes to view helpers.
Your commit includes something more:
/**
* Attribute prefixes valid for all tags
*
* @var array
*/
protected $validTagAttributePrefixes = [
'data-' => true,
'aria-' => true,
'x-' => true,
];
/**
* Adds a prefix to the list of valid attribute prefixes
*
* @param string $prefix
*
* @return AbstractHelper
*/
public function addValidAttributePrefix($prefix)
{
$this->validTagAttributePrefixes[$prefix] = true;
return $this;
}
Please don't mix different topics in one commit. That would help a lot!
For the moment I added the label "work in progress". I have to look for side effects.
Related to #50
Apologies for the mixed initial commit, I'll try and be more careful in future. Validation and non-optimal test cases have been added.
Thanks, @Brindster!
Currently, the list of valid attributes on the form view helpers is fixed. This pull request adds the ability to add additional valid attributes to view helpers.
My use case is that certain javascript frameworks use non standard attributes (such as
ng-
,v-
) when binding on form elements. It would simplify development ifZend/Form
were able to specify these attributes on form inputs.