8000 Remove 'acme' by ifdattic · Pull Request #4881 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Remove 'acme' #4881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions cookbook/form/dynamic_form_modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
);
Expand All @@ -425,22 +425,22 @@ access to the form factory, you then use::
{
public function newAction(Request $request)
{
$form = $this->get('form.factory 77DA 9;)->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:
Expand Down
0