diff --git a/book/forms.rst b/book/forms.rst index a4b95fd62c9..d5c969b8d1c 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -1066,7 +1066,7 @@ that will house the logic for building the task form:: public function getName() { - return 'task'; + return 'app_task'; } } @@ -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 @@ -1186,7 +1186,7 @@ easy to use in your application. - + @@ -1200,7 +1200,7 @@ easy to use in your application. 'AppBundle\Form\Type\TaskType' ) ->addTag('form.type', array( - 'alias' => 'task', + 'alias' => 'app_task', )) ; diff --git a/cookbook/form/create_custom_field_type.rst b/cookbook/form/create_custom_field_type.rst index 9a03ef7f501..8a8e0e96e0a 100644 --- a/cookbook/form/create_custom_field_type.rst +++ b/cookbook/form/create_custom_field_type.rst @@ -45,7 +45,7 @@ for form fields, which is ``\Form\Type``. Make sure the field extend public function getName() { - return 'gender'; + return 'app_gender'; } } @@ -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 %genders% - + .. code-block:: php @@ -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', )) ; diff --git a/cookbook/form/create_form_type_extension.rst b/cookbook/form/create_form_type_extension.rst index 153b0b7fc57..39e23350f80 100644 --- a/cookbook/form/create_form_type_extension.rst +++ b/cookbook/form/create_form_type_extension.rst @@ -312,7 +312,7 @@ next to the file field. For example:: public function getName() { - return 'media'; + return 'app_media'; } } diff --git a/cookbook/form/dynamic_form_modification.rst b/cookbook/form/dynamic_form_modification.rst index 006955d9d67..7b5a5d589d2 100644 --- a/cookbook/form/dynamic_form_modification.rst +++ b/cookbook/form/dynamic_form_modification.rst @@ -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) @@ -393,7 +393,7 @@ 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 @@ -401,7 +401,7 @@ it with :ref:`dic-tags-form-type`. - + @@ -409,7 +409,7 @@ it with :ref:`dic-tags-form-type`. // 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, @@ -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'); // ... } @@ -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: