Merge pull request #1962 from adrozdek/fix/symfony-documentation

Fixed small typos for Symfony docs.
This commit is contained in:
Tomáš Votruba 2019-09-06 22:18:08 +02:00 committed by GitHub
commit 037ec9bf6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View File

@ -5402,8 +5402,7 @@ Changes createForm(new FormType), add(new FormType) to ones with "FormType::clas
+ $form = $this->createForm(TeamType::class, $entity, [
'action' => $this->generateUrl('teams_update', ['id' => $entity->getId()]),
'method' => 'PUT',
- ]);
+ ));
]);
}
}
```
@ -5595,7 +5594,7 @@ Change "read_only" option in form to attribute
function buildForm(FormBuilderInterface $builder, array $options)
{
- $builder->add('cuid', TextType::class, ['read_only' => true]);
+ $builder->add('cuid', TextType::class, ['attr' => [read_only' => true]]);
+ $builder->add('cuid', TextType::class, ['attr' => ['read_only' => true]]);
}
```
@ -5698,7 +5697,7 @@ Turns string Form Type references to their CONSTANT alternatives in FormTypes in
```diff
$formBuilder = new Symfony\Component\Form\FormBuilder;
-$formBuilder->add('name', 'form.type.text');
+$form->add('name', \Symfony\Component\Form\Extension\Core\Type\TextType::class);
+$formBuilder->add('name', \Symfony\Component\Form\Extension\Core\Type\TextType::class);
```
<br>

View File

@ -50,7 +50,7 @@ CODE_SAMPLE
,
<<<'CODE_SAMPLE'
$formBuilder = new Symfony\Component\Form\FormBuilder;
$form->add('name', \Symfony\Component\Form\Extension\Core\Type\TextType::class);
$formBuilder->add('name', \Symfony\Component\Form\Extension\Core\Type\TextType::class);
CODE_SAMPLE
),
]

View File

@ -94,7 +94,7 @@ class SomeController
$form = $this->createForm(TeamType::class, $entity, [
'action' => $this->generateUrl('teams_update', ['id' => $entity->getId()]),
'method' => 'PUT',
));
]);
}
}
CODE_SAMPLE

View File

@ -52,7 +52,7 @@ use Symfony\Component\Form\FormBuilderInterface;
function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('cuid', TextType::class, ['attr' => [read_only' => true]]);
$builder->add('cuid', TextType::class, ['attr' => ['read_only' => true]]);
}
CODE_SAMPLE
),