Skip to content

Commit 457c7eb

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: Consistency in form widget names Update Length constraint description (mb_strlen)
2 parents 39869cc + ab153cd commit 457c7eb

File tree

6 files changed

+12
-13
lines changed

6 files changed

+12
-13
lines changed

form/create_custom_field_type.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ one of your forms::
278278
{
279279
public function buildForm(FormBuilderInterface $builder, array $options)
280280
{
281-
$builder->add('shipping_code', ShippingType::class, [
281+
$builder->add('shippingCode', ShippingType::class, [
282282
'placeholder' => 'Choose a delivery option',
283283
]);
284284
}

form/events.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ method of the ``FormFactory``::
271271

272272
$form = $formFactory->createBuilder()
273273
->add('username', TextType::class)
274-
->add('show_email', CheckboxType::class)
274+
->add('showEmail', CheckboxType::class)
275275
->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) {
276276
$user = $event->getData();
277277
$form = $event->getForm();
@@ -283,7 +283,7 @@ method of the ``FormFactory``::
283283
// checks whether the user has chosen to display their email or not.
284284
// If the data was submitted previously, the additional value that is
285285
// included in the request variables needs to be removed.
286-
if (true === $user['show_email']) {
286+
if (true === $user['showEmail']) {
287287
$form->add('email', EmailType::class);
288288
} else {
289289
unset($user['email']);
@@ -312,7 +312,7 @@ callback for better readability::
312312
{
313313
$builder
314314
->add('username', TextType::class)
315-
->add('show_email', CheckboxType::class)
315+
->add('showEmail', CheckboxType::class)
316316
->addEventListener(
317317
FormEvents::PRE_SET_DATA,
318318
[$this, 'onPreSetData']
@@ -379,7 +379,7 @@ Consider the following example of a form event subscriber::
379379
// checks whether the user has chosen to display their email or not.
380380
// If the data was submitted previously, the additional value that
381381
// is included in the request variables needs to be removed.
382-
if (true === $user['show_email']) {
382+
if (true === $user['showEmail']) {
383383
$form->add('email', EmailType::class);
384384
} else {
385385
unset($user['email']);
@@ -398,7 +398,7 @@ To register the event subscriber, use the ``addEventSubscriber()`` method::
398398

399399
$form = $formFactory->createBuilder()
400400
->add('username', TextType::class)
401-
->add('show_email', CheckboxType::class)
401+
->add('showEmail', CheckboxType::class)
402402
->addEventSubscriber(new AddEmailFieldListener())
403403
->getForm();
404404

reference/constraints/Length.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,9 @@ charset
119119

120120
**type**: ``string`` **default**: ``UTF-8``
121121

122-
The charset to be used when computing value's length. The
123-
:phpfunction:`grapheme_strlen` PHP function is used if available. If not,
124-
the :phpfunction:`mb_strlen` PHP function is used if available. If neither
125-
are available, the :phpfunction:`strlen` PHP function is used.
122+
The charset to be used when computing value's length with the
123+
:phpfunction:`mb_check_encoding` and :phpfunction:`mb_strlen`
124+
PHP functions.
126125

127126
charsetMessage
128127
~~~~~~~~~~~~~~

reference/forms/types/collection.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ type::
308308
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
309309
// ...
310310

311-
$builder->add('favorite_cities', CollectionType::class, [
311+
$builder->add('favoriteCities', CollectionType::class, [
312312
'entry_type' => ChoiceType::class,
313313
'entry_options' => [
314314
'choices' => [

reference/forms/types/options/date_format.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For more information on valid formats, see `Date/Time Format Syntax`_::
1616
use Symfony\Component\Form\Extension\Core\Type\DateType;
1717
// ...
1818

19-
$builder->add('date_created', DateType::class, [
19+
$builder->add('dateCreated', DateType::class, [
2020
'widget' => 'single_text',
2121
// this is actually the default format for single_text
2222
'format' => 'yyyy-MM-dd',

reference/forms/types/options/invalid_message_parameters.rst.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ When setting the ``invalid_message`` option, you may need to
77
include some variables in the string. This can be done by adding placeholders
88
to that option and including the variables in this option::
99

10-
$builder->add('some_field', SomeFormType::class, [
10+
$builder->add('someField', SomeFormType::class, [
1111
// ...
1212
'invalid_message' => 'You entered an invalid value, it should include %num% letters',
1313
'invalid_message_parameters' => ['%num%' => 6],

0 commit comments

Comments
 (0)