You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 30, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,18 @@
2
2
3
3
All notable changes to this project will be documented in this file, in reverse chronological order by release.
4
4
5
-
## 2.11.1 - TBD
5
+
## 2.12.0 - 2018-05-16
6
6
7
7
### Added
8
8
9
+
-[#194](https://github.com/zendframework/zend-form/pull/194) adds the ability to whitelist additional HTML attributes for use with a view helper,
10
+
as well as attribute prefixes. These can be enabled via the following:
11
+
12
+
```php
13
+
$helper->addValidAttribute('attribute-name');
14
+
$helper->addValidAttributePrefix('prefix-');
15
+
```
16
+
9
17
-[#188](https://github.com/zendframework/zend-form/pull/188) adds a new method to the `FormElementErrors` view helper, `setTranslateMessages(bool $flag)`.
10
18
By default, the helper continues to translate error messages (if a translator
11
19
is present), as introduced in 2.11.0. However, using this method, you can
@@ -23,9 +31,9 @@ All notable changes to this project will be documented in this file, in reverse
23
31
### Changed
24
32
25
33
-[#193](https://github.com/zendframework/zend-form/pull/193) modifies how attributes are escaped. If zend-espaper raises an exception
26
-
for an invalid attribute value, helpers will now catch the exception, and use a
27
-
blank value for the attribute. This prevents 500 errors from being raised for
28
-
such pages.
34
+
for an invalid attribute value, helpers will now catch the exception, and use
35
+
a blank value for the attribute. This prevents 500 errors from being raised
Copy file name to clipboardExpand all lines: docs/book/helper/abstract-helper.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,8 @@ Method signature | Description
25
25
`addTranslatableAttributePrefix(string $prefix) : self` | Marks all HTML attributes that start with the given prefix as translatable.
26
26
`addDefaultTranslatableAttribute(string $attribute) : void` | Marks the given HTML attribute as translatable for all view helpers.
27
27
`addDefaultTranslatableAttributePrefix(string $prefix) : void` | Marks all HTML attributes that start with the given prefix as translatable for all view helpers.
28
+
`addValidAttribute(string $attribute) : self` | Add an HTML attribute to the list of valid attributes for the given element.
29
+
`addValidAttributePrefix(string $prefix) : self` | Add an HTML attribute prefix to the list of valid attribute prefixes. Any attribute with this preix will be considered valid. By default, the list includes "data-", "aria-", and "x-".
28
30
29
31
## Translation
30
32
@@ -69,3 +71,27 @@ Or you can mark them as translatable for all view helpers (e. g. the title attri
Copy file name to clipboardExpand all lines: docs/book/helper/form-element-errors.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,4 +70,5 @@ Method signature | Descripti
70
70
`getMessageCloseString() : string` | Returns the string used to close message representation.
71
71
`setAttributes(array $attributes) : void` | Set the attributes that will go on the message open format as key/value pairs.
72
72
`getAttributes() : array` | Returns the attributes that will go on the message open format.
73
+
`setTranslateMessages(bool $flag) : self` | Indicate whether or not element validation error messages should be translated during `render()`. Default is to translate them.
73
74
`render(ElementInterface $element [, array $attributes = array()]) : string` | Renders validation errors for the provided `$element`. Attributes provided will be used in the `messageOpenFormat`, and merged with any provided previously via `setAttributes()`.
0 commit comments