Skip to content

Commit

Permalink
added app_ prefix to form type names
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark authored and wouterj committed Dec 19, 2015
1 parent 1edb61e commit 716a4f2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
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
6 changes: 3 additions & 3 deletions cookbook/form/create_custom_field_type.rst
Original file line number Diff line number Diff line change
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

0 comments on commit 716a4f2

Please sign in to comment.