Skip to content

Finish #5798 Add app_ prefix to form type names #6049

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

Merged
merged 2 commits into from
Dec 19, 2015
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ that will house the logic for building the task form::

public function getName()
{
return 'task';
return 'app_task';
}
}

Expand Down Expand Up @@ -1174,7 +1174,7 @@ easy to use in your application.
app.form.type.task:
class: AppBundle\Form\Type\TaskType
tags:
- { name: form.type, alias: task }
- { name: form.type, alias: app_task }

.. code-block:: xml

Expand All @@ -1186,7 +1186,7 @@ easy to use in your application.

<services>
<service id="app.form.type.task" class="AppBundle\Form\Type\TaskType">
<tag name="form.type" alias="task" />
<tag name="form.type" alias="app_task" />
</service>
</services>
</container>
Expand All @@ -1200,7 +1200,7 @@ easy to use in your application.
'AppBundle\Form\Type\TaskType'
)
->addTag('form.type', array(
'alias' => 'task',
'alias' => 'app_task',
))
;

Expand Down
8 changes: 4 additions & 4 deletions cookbook/form/create_custom_field_type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ for form fields, which is ``<BundleName>\Form\Type``. Make sure the field extend

public function getName()
{
return 'gender';
return 'app_gender';
}
}

Expand Down Expand Up @@ -308,14 +308,14 @@ the ``genders`` parameter value as the first argument to its to-be-created
arguments:
- '%genders%'
tags:
- { name: form.type, alias: gender }
- { name: form.type, alias: app_gender }

.. code-block:: xml

<!-- src/AppBundle/Resources/config/services.xml -->
<service id="app.form.type.gender" class="AppBundle\Form\Type\GenderType">
<argument>%genders%</argument>
<tag name="form.type" alias="gender" />
<tag name="form.type" alias="app_gender" />
</service>

.. code-block:: php
Expand All @@ -329,7 +329,7 @@ the ``genders`` parameter value as the first argument to its to-be-created
array('%genders%')
))
->addTag('form.type', array(
'alias' => 'gender',
'alias' => 'app_gender',
))
;

Expand Down
2 changes: 1 addition & 1 deletion cookbook/form/create_form_type_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ next to the file field. For example::

public function getName()
{
return 'media';
return 'app_media';
}
}

Expand Down
12 changes: 6 additions & 6 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 'friend_message';
return 'app_friend_message';
}

public function setDefaultOptions(OptionsResolverInterface $resolver)
Expand Down Expand Up @@ -393,23 +393,23 @@ it with :ref:`dic-tags-form-type`.
class: AppBundle\Form\Type\FriendMessageFormType
arguments: ['@security.context']
tags:
- { name: form.type, alias: friend_message }
- { name: form.type, alias: app_friend_message }

.. code-block:: xml

<!-- app/config/config.xml -->
<services>
<service id="app.form.friend_message" class="AppBundle\Form\Type\FriendMessageFormType">
<argument type="service" id="security.context" />
<tag name="form.type" alias="friend_message" />
<tag name="form.type" alias="app_friend_message" />
</service>
</services>

.. code-block:: php

// app/config/config.php
$definition = new Definition('AppBundle\Form\Type\FriendMessageFormType');
$definition->addTag('form.type', array('alias' => 'friend_message'));
$definition->addTag('form.type', array('alias' => 'app_friend_message'));
$container->setDefinition(
'app.form.friend_message',
$definition,
Expand All @@ -430,7 +430,7 @@ class, you can simply call::
{
public function newAction(Request $request)
{
$form = $this->createForm('friend_message');
$form = $this->createForm('app_friend_message');

// ...
}
Expand All @@ -441,7 +441,7 @@ 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', 'friend_message');
$builder->add('message', 'app_friend_message');
}

.. _cookbook-form-events-submitted-data:
Expand Down