Contributed by
Arnaud Petitpas
in #22679.
The HTML5 specification defines several form fields that are still not supported
by Symfony Forms. In Symfony 3.4 we implemented two of these new HTML5 form
fields which have a good support in modern browsers: TelType
(for telephone
numbers) and ColorType
(for color pickers).
TimezoneType
¶
Contributed by
Roland Franssen
in #23648.
The TimezoneType
defines two new options: input
and regions
. The
input
option defines the format that the timezone is stored in your
underlying object. The value can be string
(e.g. America/New_York
) and
datetimezone
(which returns a DateTimeZone
object).
The regions
option filters the timezones to only display the ones that belong
to the given region or regions. For example, to display just the timezones of
Europe and America: DateTimeZone::AMERICA | DateTimeZone::EUROPE
.
delete_empty
option¶
Contributed by
Konstantin Myakshin
in #20496.
In addition to boolean values, the delete_empty
now accepts PHP callbacks to
decide if items should be deleted. In case of compound entries, you can now do this:
1 2 3 | 'delete_empty' => function (Author $author = null) {
return null === $author || empty($author->firstName);
},
|
In case of compound entries without data_class
:
1 2 3 | 'delete_empty' => function ($author) {
return empty($author['firstName']);
},
|
What a Symfony developer should know about the framework: News, Jobs, Tweets, Events, Videos,...