Permalink
Browse files

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'
  • Loading branch information...
wouterj committed Jan 23, 2015
2 parents 6a15077 + f76ff18 commit 3774a375bc5ccb32d04546f97bf65d74656575df
Showing with 10 additions and 10 deletions.
  1. +10 −10 cookbook/form/dynamic_form_modification.rst
@@ -246,7 +246,7 @@ Using an event listener, your form might look like this::
public function getName()
{
return 'acme_friend_message';
return 'friend_message';
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
@@ -389,29 +389,29 @@ it with :ref:`dic-tags-form-type`.
# app/config/config.yml
services:
acme.form.friend_message:
app.form.friend_message:
class: AppBundle\Form\Type\FriendMessageFormType
arguments: ["@security.context"]
tags:
- { name: form.type, alias: acme_friend_message }
- { name: form.type, alias: friend_message }
.. code-block:: xml
<!-- app/config/config.xml -->
<services>
<service id="acme.form.friend_message" class="AppBundle\Form\Type\FriendMessageFormType">
<service id="app.form.friend_message" class="AppBundle\Form\Type\FriendMessageFormType">
<argument type="service" id="security.context" />
<tag name="form.type" alias="acme_friend_message" />
<tag name="form.type" alias="friend_message" />
</service>
</services>
.. code-block:: php
// app/config/config.php
$definition = new Definition('AppBundle\Form\Type\FriendMessageFormType');
$definition->addTag('form.type', array('alias' => 'acme_friend_message'));
$definition->addTag('form.type', array('alias' => 'friend_message'));
$container->setDefinition(
'acme.form.friend_message',
'app.form.friend_message',
$definition,
array('security.context')
);
@@ -425,22 +425,22 @@ access to the form factory, you then use::
{
public function newAction(Request $request)
{
$form = $this->get('form.factory')->create('acme_friend_message');
$form = $this->get('form.factory')->create('friend_message');
// ...
}
}
If you extend the ``Symfony\Bundle\FrameworkBundle\Controller\Controller`` class, you can simply call::
$form = $this->createForm('acme_friend_message');
$form = $this->createForm('friend_message');
You can also easily embed the form type into another form::
// inside some other "form type" class
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('message', 'acme_friend_message');
$builder->add('message', 'friend_message');
}
.. _cookbook-form-events-submitted-data:

0 comments on commit 3774a37

Please sign in to comment.