diff --git a/form/action_method.rst b/form/action_method.rst index bb99ab052e9..2cea4ab8226 100644 --- a/form/action_method.rst +++ b/form/action_method.rst @@ -15,7 +15,7 @@ form, you can use ``setAction()`` and ``setMethod()``: .. code-block:: php-symfony - // AppBundle/Controller/DefaultController.php + // src/Controller/DefaultController.php namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; @@ -75,11 +75,11 @@ options: .. code-block:: php-symfony - // AppBundle/Controller/DefaultController.php + // src/Controller/DefaultController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; use App\Form\TaskType; + use Symfony\Bundle\FrameworkBundle\Controller\Controller; class DefaultController extends Controller { @@ -98,8 +98,8 @@ options: .. code-block:: php-standalone - use Symfony\Component\Form\Forms; use App\Form\TaskType; + use Symfony\Component\Form\Forms; $formFactoryBuilder = Forms::createFormFactoryBuilder(); diff --git a/form/create_custom_field_type.rst b/form/create_custom_field_type.rst index 40c223f8267..936591f627f 100644 --- a/form/create_custom_field_type.rst +++ b/form/create_custom_field_type.rst @@ -104,7 +104,7 @@ the class name of your type. For more information, see :ref:`form-customization- When the name of your form class matches any of the built-in field types, your form might not be rendered correctly. A form type named - ``AppBundle\Form\PasswordType`` will have the same block name as the + ``App\Form\PasswordType`` will have the same block name as the built-in ``PasswordType`` and won't be rendered correctly. Override the ``getBlockPrefix()`` method to return a unique block prefix (e.g. ``app_password``) to avoid collisions. @@ -169,14 +169,14 @@ link for details), create a ``shipping_widget`` block to handle this: .. code-block:: yaml - # app/config/config.yml + # config/packages/twig.yaml twig: form_themes: - 'form/fields.html.twig' .. code-block:: xml - + loadFromExtension('twig', array( 'form_themes' => array( 'form/fields.html.twig', @@ -206,7 +206,7 @@ link for details), create a ``shipping_widget`` block to handle this: .. code-block:: yaml - # app/config/config.yml + # config/packages/framework.yaml framework: templating: form: @@ -215,7 +215,7 @@ link for details), create a ``shipping_widget`` block to handle this: .. code-block:: xml - + loadFromExtension('framework', array( 'templating' => array( 'form' => array( diff --git a/form/dynamic_form_modification.rst b/form/dynamic_form_modification.rst index bb64ef3a938..b537f89a462 100644 --- a/form/dynamic_form_modification.rst +++ b/form/dynamic_form_modification.rst @@ -392,7 +392,7 @@ sport like this:: { $builder ->add('sport', EntityType::class, array( - 'class' => 'AppBundle:Sport', + 'class' => 'App:Sport', 'placeholder' => '', )) ; @@ -409,7 +409,7 @@ sport like this:: $positions = null === $sport ? array() : $sport->getAvailablePositions(); $form->add('position', EntityType::class, array( - 'class' => 'AppBundle:Position', + 'class' => 'App:Position', 'placeholder' => '', 'choices' => $positions, )); @@ -445,10 +445,10 @@ The type would now look like:: // src/Form/Type/SportMeetupType.php namespace App\Form\Type; - // ... + use App\Entity\Sport; use Symfony\Component\Form\FormInterface; use Symfony\Bridge\Doctrine\Form\Type\EntityType; - use App\Entity\Sport; + // ... class SportMeetupType extends AbstractType { @@ -456,7 +456,7 @@ The type would now look like:: { $builder ->add('sport', EntityType::class, array( - 'class' => 'AppBundle:Sport', + 'class' => 'App:Sport', 'placeholder' => '', )); ; @@ -465,7 +465,7 @@ The type would now look like:: $positions = null === $sport ? array() : $sport->getAvailablePositions(); $form->add('position', EntityType::class, array( - 'class' => 'AppBundle:Position', + 'class' => 'App:Position', 'placeholder' => '', 'choices' => $positions, )); diff --git a/form/form_collections.rst b/form/form_collections.rst index c665143948f..9ef213d8fb5 100644 --- a/form/form_collections.rst +++ b/form/form_collections.rst @@ -488,7 +488,7 @@ you will learn about next!). Doctrine: A new entity was found through the relationship - ``AppBundle\Entity\Task#tags`` that was not configured to + ``App\Entity\Task#tags`` that was not configured to cascade persist operations for entity... To fix this, you may choose to "cascade" the persist operation automatically diff --git a/form/form_customization.rst b/form/form_customization.rst index c9b7814f052..2b222689fb6 100644 --- a/form/form_customization.rst +++ b/form/form_customization.rst @@ -483,7 +483,7 @@ rendered. .. code-block:: yaml - # app/config/config.yml + # config/packages/twig.yaml twig: form_themes: - 'form/fields.html.twig' @@ -491,7 +491,7 @@ rendered. .. code-block:: xml - + loadFromExtension('twig', array( 'form_themes' => array( 'form/fields.html.twig', @@ -526,7 +526,7 @@ resource to use such a layout: .. code-block:: yaml - # app/config/config.yml + # config/packages/twig.yaml twig: form_themes: - 'form_table_layout.html.twig' @@ -534,7 +534,7 @@ resource to use such a layout: .. code-block:: xml - + loadFromExtension('twig', array( 'form_themes' => array( 'form_table_layout.html.twig', @@ -575,24 +575,24 @@ PHP ~~~ By using the following configuration, any customized form fragments inside the -``templates/Form`` folder will be used globally when a +``templates/form`` folder will be used globally when a form is rendered. .. configuration-block:: .. code-block:: yaml - # app/config/config.yml + # config/packages/framework.yaml framework: templating: form: resources: - - 'AppBundle:Form' + - 'App:Form' # ... .. code-block:: xml - + - AppBundle:Form + App:Form @@ -614,13 +614,13 @@ form is rendered. .. code-block:: php - // app/config/config.php + // config/packages/framework.php // PHP $container->loadFromExtension('framework', array( 'templating' => array( 'form' => array( 'resources' => array( - 'AppBundle:Form', + 'App:Form', ), ), ), @@ -636,7 +636,7 @@ resource to use such a layout: .. code-block:: yaml - # app/config/config.yml + # config/packages/framework.yaml framework: templating: form: @@ -645,7 +645,7 @@ resource to use such a layout: .. code-block:: xml - + loadFromExtension('framework', array( 'templating' => array( 'form' => array( diff --git a/form/form_themes.rst b/form/form_themes.rst index 65b276c03c3..1d2123c6b71 100644 --- a/form/form_themes.rst +++ b/form/form_themes.rst @@ -199,7 +199,7 @@ file: .. code-block:: yaml - # app/config/config.yml + # config/packages/twig.yaml twig: form_themes: - 'form/fields.html.twig' @@ -207,7 +207,7 @@ file: .. code-block:: xml - + loadFromExtension('twig', array( 'form_themes' => array( 'form/fields.html.twig', @@ -280,7 +280,7 @@ file: .. code-block:: yaml - # app/config/config.yml + # config/packages/framework.yaml framework: templating: form: @@ -290,7 +290,7 @@ file: .. code-block:: xml - + loadFromExtension('framework', array( 'templating' => array( 'form' => array(