Skip to content

Commit 3774a37

Browse files
committed
minor #4881 Remove 'acme' (ifdattic)
This PR was squashed before being merged into the 2.3 branch (closes #4881). Discussion ---------- Remove 'acme' | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | Commits ------- f76ff18 Remove 'acme'
2 parents 6a15077 + f76ff18 commit 3774a37

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

cookbook/form/dynamic_form_modification.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Using an event listener, your form might look like this::
246246

247247
public function getName()
248248
{
249-
return 'acme_friend_message';
249+
return 'friend_message';
250250
}
251251

252252
public function setDefaultOptions(OptionsResolverInterface $resolver)
@@ -389,29 +389,29 @@ it with :ref:`dic-tags-form-type`.
389389
390390
# app/config/config.yml
391391
services:
392-
acme.form.friend_message:
392+
app.form.friend_message:
393393
class: AppBundle\Form\Type\FriendMessageFormType
394394
arguments: ["@security.context"]
395395
tags:
396-
- { name: form.type, alias: acme_friend_message }
396+
- { name: form.type, alias: friend_message }
397397
398398
.. code-block:: xml
399399
400400
<!-- app/config/config.xml -->
401401
<services>
402-
<service id="acme.form.friend_message" class="AppBundle\Form\Type\FriendMessageFormType">
402+
<service id="app.form.friend_message" class="AppBundle\Form\Type\FriendMessageFormType">
403403
<argument type="service" id="security.context" />
404-
<tag name="form.type" alias="acme_friend_message" />
404+
<tag name="form.type" alias="friend_message" />
405405
</service>
406406
</services>
407407
408408
.. code-block:: php
409409
410410
// app/config/config.php
411411
$definition = new Definition('AppBundle\Form\Type\FriendMessageFormType');
412-
$definition->addTag('form.type', array('alias' => 'acme_friend_message'));
412+
$definition->addTag('form.type', array('alias' => 'friend_message'));
413413
$container->setDefinition(
414-
'acme.form.friend_message',
414+
'app.form.friend_message',
415415
$definition,
416416
array('security.context')
417417
);
@@ -425,22 +425,22 @@ access to the form factory, you then use::
425425
{
426426
public function newAction(Request $request)
427427
{
428-
$form = $this->get('form.factory')->create('acme_friend_message');
428+
$form = $this->get('form.factory')->create('friend_message');
429429

430430
// ...
431431
}
432432
}
433433

434434
If you extend the ``Symfony\Bundle\FrameworkBundle\Controller\Controller`` class, you can simply call::
435435

436-
$form = $this->createForm('acme_friend_message');
436+
$form = $this->createForm('friend_message');
437437

438438
You can also easily embed the form type into another form::
439439

440440
// inside some other "form type" class
441441
public function buildForm(FormBuilderInterface $builder, array $options)
442442
{
443-
$builder->add('message', 'acme_friend_message');
443+
$builder->add('message', 'friend_message');
444444
}
445445

446446
.. _cookbook-form-events-submitted-data:

0 commit comments

Comments
 (0)