From a6a3b9c3788ae060be19354207d047e6623750a0 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Wed, 14 Jan 2015 10:04:30 +0200 Subject: [PATCH 01/20] Update inheritance.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/bundles/inheritance.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/bundles/inheritance.rst b/cookbook/bundles/inheritance.rst index 13500eb6685..25c29da67fc 100644 --- a/cookbook/bundles/inheritance.rst +++ b/cookbook/bundles/inheritance.rst @@ -91,7 +91,7 @@ The same goes for routing files and some other resources. .. note:: The overriding of resources only works when you refer to resources with - the ``@FosUserBundle/Resources/config/routing/security.xml`` method. + the ``@FOSUserBundle/Resources/config/routing/security.xml`` method. If you refer to resources without using the @BundleName shortcut, they can't be overridden in this way. From b4ee5fb90eb8362cdf18dfafb29f725ec2f2ae64 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Sat, 10 Jan 2015 12:36:07 +0200 Subject: [PATCH 02/20] Update security.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- book/security.rst | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/book/security.rst b/book/security.rst index c159d2429af..7336316abaf 100644 --- a/book/security.rst +++ b/book/security.rst @@ -56,14 +56,17 @@ configuration looks like this: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> - + @@ -145,7 +148,8 @@ To activate this, add the ``http_basic`` key under your firewall: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> @@ -216,7 +220,8 @@ user to be logged in to access this URL: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> @@ -309,7 +314,8 @@ provider, but it's better to think of it as an "in configuration" provider: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> @@ -376,7 +382,8 @@ To fix this, add an ``encoders`` key: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> @@ -456,13 +463,16 @@ else, you'll want to encode their passwords. The best algorithm to use is + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> + algorithm="bcrypt" + cost="12" /> + @@ -514,7 +524,8 @@ like this: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> @@ -681,7 +692,8 @@ URL pattern. You saw this earlier, where anything matching the regular expressio + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> From 0d059fff7eab3b36860c82a7e8d20a98e7206ea7 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Sun, 11 Jan 2015 11:28:21 +0200 Subject: [PATCH 03/20] Update http_cache.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- book/http_cache.rst | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/book/http_cache.rst b/book/http_cache.rst index 658288f1958..eae091e92ab 100644 --- a/book/http_cache.rst +++ b/book/http_cache.rst @@ -856,7 +856,7 @@ If one content corresponds to one URL, the ``PURGE`` model works well. You send a request to the cache proxy with the HTTP method ``PURGE`` (using the word "PURGE" is a convention, technically this can be any string) instead of ``GET`` and make the cache proxy detect this and remove the data from the -cache instead of going to Symfony to get a response. +cache instead of going to the application to get a response. Here is how you can configure the Symfony reverse proxy to support the ``PURGE`` HTTP method:: @@ -877,7 +877,10 @@ Here is how you can configure the Symfony reverse proxy to support the } if ('127.0.0.1' !== $request->getClientIp()) { - return new Response('Invalid HTTP method', Response::HTTP_BAD_REQUEST); + return new Response( + 'Invalid HTTP method', + Response::HTTP_BAD_REQUEST + ); } $response = new Response(); @@ -987,8 +990,10 @@ First, to use ESI, be sure to enable it in your application configuration: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -1115,8 +1120,10 @@ that must be enabled in your configuration: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> From 8b6cd17d023ba7377812a24a23cd183fb14114e9 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Mon, 12 Jan 2015 09:57:05 +0200 Subject: [PATCH 04/20] Update testing.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- book/testing.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/book/testing.rst b/book/testing.rst index d51699e552b..19d6443d83d 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -558,7 +558,8 @@ narrow down your node selection by chaining the method calls:: return false; } }) - ->first(); + ->first() + ; .. tip:: @@ -720,8 +721,10 @@ configuration option: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/swiftmailer + http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd"> @@ -784,8 +787,9 @@ machine only. the ``app/phpunit.xml`` file. By default, only the tests from your own custom bundles stored in the standard -directories ``src/*/*Bundle/Tests`` or ``src/*/Bundle/*Bundle/Tests`` are run -by the ``phpunit`` command, as configured in the ``app/phpunit.xml.dist`` file: +directories ``src/*/*Bundle/Tests``, ``src/*/Bundle/*Bundle/Tests``, +``src/*Bundle/Tests`` are run by the ``phpunit`` command, as configured +in the ``app/phpunit.xml.dist`` file: .. code-block:: xml @@ -796,6 +800,7 @@ by the ``phpunit`` command, as configured in the ``app/phpunit.xml.dist`` file: ../src/*/*Bundle/Tests ../src/*/Bundle/*Bundle/Tests + ../src/*Bundle/Tests From 4eb8b643c0a5e2d3218fbc08a57728100b2626d7 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Tue, 13 Jan 2015 10:36:52 +0200 Subject: [PATCH 05/20] Update doctrine.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- book/doctrine.rst | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/book/doctrine.rst b/book/doctrine.rst index 0f3f62086d0..ca51d143e18 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -77,8 +77,10 @@ information. By convention, this information is usually configured in an + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/doctrine + http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd"> + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/doctrine + http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd"> getDoctrine()->getManager(); $products = $em->getRepository('AppBundle:Product') - ->findAllOrderedByName(); + ->findAllOrderedByName(); .. note:: @@ -884,7 +889,9 @@ you can let Doctrine create the class for you. .. code-block:: bash - $ php app/console doctrine:generate:entity --entity="AppBundle:Category" --fields="name:string(255)" + $ php app/console doctrine:generate:entity \ + --entity="AppBundle:Category" \ + --fields="name:string(255)" This task generates the ``Category`` entity for you, with an ``id`` field, a ``name`` field and the associated getter and setter functions. @@ -929,7 +936,8 @@ To relate the ``Category`` and ``Product`` entities, start by creating a products: targetEntity: Product mappedBy: category - # don't forget to init the collection in the __construct() method of the entity + # don't forget to init the collection in the __construct() method + # of the entity .. code-block:: xml @@ -1038,7 +1046,7 @@ methods for you: .. code-block:: bash - $ php app/console doctrine:generate:entities Acme + $ php app/console doctrine:generate:entities AppBundle Ignore the Doctrine metadata for a moment. You now have two classes - ``Category`` and ``Product`` with a natural one-to-many relationship. The ``Category`` @@ -1151,7 +1159,7 @@ the category (i.e. it's "lazily loaded"). You can also query in the other direction:: - public function showProductAction($id) + public function showProductsAction($id) { $category = $this->getDoctrine() ->getRepository('AppBundle:Category') @@ -1372,7 +1380,7 @@ list of all available types and more information, see Doctrine's Summary ------- -With Doctrine, you can focus on your objects and how they're useful in your +With Doctrine, you can focus on your objects and how they're used in your application and worry about database persistence second. This is because Doctrine allows you to use any PHP object to hold your data and relies on mapping metadata information to map an object's data to a particular database From 76b23affff050140e9390c805e0b71699ec44728 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Tue, 13 Jan 2015 11:10:04 +0200 Subject: [PATCH 06/20] Update translation.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- book/translation.rst | 52 ++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/book/translation.rst b/book/translation.rst index d6094a3a5d7..39fe75031de 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -68,8 +68,10 @@ enable the ``translator`` in your configuration: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -366,7 +368,8 @@ provides many loaders, including: * ``yml``: YAML file. The choice of which loader to use is entirely up to you and is a matter of -taste. For more options, see :ref:`component-translator-message-catalogs`. +taste. The recommended option is to use ``xliff`` for translations. +For more options, see :ref:`component-translator-message-catalogs`. .. note:: @@ -454,7 +457,7 @@ by the routing system using the special ``_locale`` parameter: # app/config/routing.yml contact: path: /{_locale}/contact - defaults: { _controller: AcmeDemoBundle:Contact:index } + defaults: { _controller: AppBundle:Contact:index } requirements: _locale: en|fr|de @@ -468,7 +471,7 @@ by the routing system using the special ``_locale`` parameter: http://symfony.com/schema/routing/routing-1.0.xsd"> - AcmeDemoBundle:Contact:index + AppBundle:Contact:index en|fr|de @@ -483,7 +486,7 @@ by the routing system using the special ``_locale`` parameter: $collection->add('contact', new Route( '/{_locale}/contact', array( - '_controller' => 'AcmeDemoBundle:Contact:index', + '_controller' => 'AppBundle:Contact:index', ), array( '_locale' => 'en|fr|de', @@ -524,8 +527,10 @@ the framework: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -554,8 +559,8 @@ the error messages is easy: simply create a translation resource for the To start, suppose you've created a plain-old-PHP object that you need to use somewhere in your application:: - // src/Acme/BlogBundle/Entity/Author.php - namespace Acme\BlogBundle\Entity; + // src/AppBundle/Entity/Author.php + namespace AppBundle\Entity; class Author { @@ -568,17 +573,9 @@ not empty, add the following: .. configuration-block:: - .. code-block:: yaml - - # src/Acme/BlogBundle/Resources/config/validation.yml - Acme\BlogBundle\Entity\Author: - properties: - name: - - NotBlank: { message: "author.name.not_blank" } - .. code-block:: php-annotations - // src/Acme/BlogBundle/Entity/Author.php + // src/AppBundle/Entity/Author.php use Symfony\Component\Validator\Constraints as Assert; class Author @@ -589,15 +586,24 @@ not empty, add the following: public $name; } + .. code-block:: yaml + + # src/AppBundle/Resources/config/validation.yml + AppBundle\Entity\Author: + properties: + name: + - NotBlank: { message: "author.name.not_blank" } + .. code-block:: xml - + + xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping + http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + @@ -608,7 +614,7 @@ not empty, add the following: .. code-block:: php - // src/Acme/BlogBundle/Entity/Author.php + // src/AppBundle/Entity/Author.php // ... use Symfony\Component\Validator\Mapping\ClassMetadata; From 04ae7c2f5cf9fd53633c10982d6f8daea20ee25a Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Wed, 14 Jan 2015 10:44:18 +0200 Subject: [PATCH 07/20] Update configuration.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/bundles/configuration.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbook/bundles/configuration.rst b/cookbook/bundles/configuration.rst index 445521f9c58..fd1c9ea14a1 100644 --- a/cookbook/bundles/configuration.rst +++ b/cookbook/bundles/configuration.rst @@ -384,7 +384,8 @@ Assume the XSD file is called ``hello-1.0.xsd``, the schema location will be + xsi:schemaLocation="http://acme_company.com/schema/dic/hello + http://acme_company.com/schema/dic/hello/hello-1.0.xsd"> From 8d9a47cdf13cb8660e86ac9a1ef8a31fe7e01c57 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Wed, 14 Jan 2015 10:51:25 +0200 Subject: [PATCH 08/20] Update prepend_extension.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/bundles/prepend_extension.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cookbook/bundles/prepend_extension.rst b/cookbook/bundles/prepend_extension.rst index 4c5cb7364fc..deaf7551917 100644 --- a/cookbook/bundles/prepend_extension.rst +++ b/cookbook/bundles/prepend_extension.rst @@ -68,9 +68,10 @@ in case a specific other bundle is not registered:: switch ($name) { case 'acme_something': case 'acme_other': - // set use_acme_goodbye to false in the config of acme_something and acme_other - // note that if the user manually configured use_acme_goodbye to true in the - // app/config/config.yml then the setting would in the end be true and not false + // set use_acme_goodbye to false in the config of + // acme_something and acme_other note that if the user manually + // configured use_acme_goodbye to true in the app/config/config.yml + // then the setting would in the end be true and not false $container->prependExtensionConfig($name, $config); break; } @@ -79,7 +80,8 @@ in case a specific other bundle is not registered:: // process the configuration of AcmeHelloExtension $configs = $container->getExtensionConfig($this->getAlias()); - // use the Configuration class to generate a config array with the settings "acme_hello" + // use the Configuration class to generate a config array with + // the settings "acme_hello" $config = $this->processConfiguration(new Configuration(), $configs); // check if entity_manager_name is set in the "acme_hello" configuration @@ -121,11 +123,11 @@ for ``acme_hello`` is set to ``non_default``: // app/config/config.php $container->loadFromExtension('acme_something', array( - ..., + // ... 'use_acme_goodbye' => false, 'entity_manager_name' => 'non_default', )); $container->loadFromExtension('acme_other', array( - ..., + // ... 'use_acme_goodbye' => false, )); From ff9f3150bced4f0e236bb712af0916915d8adb31 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Thu, 15 Jan 2015 08:47:32 +0200 Subject: [PATCH 09/20] Update asset_management.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/assetic/asset_management.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cookbook/assetic/asset_management.rst b/cookbook/assetic/asset_management.rst index 785e239b1a0..68d81c4553b 100644 --- a/cookbook/assetic/asset_management.rst +++ b/cookbook/assetic/asset_management.rst @@ -18,11 +18,11 @@ directly: .. code-block:: html+jinja - + .. code-block:: php - + But *with* Assetic, you can manipulate these assets however you want (or load them from anywhere) before serving them. This means you can: @@ -60,7 +60,7 @@ To include JavaScript files, use the ``javascripts`` tag in any template: .. code-block:: html+jinja {% javascripts '@AppBundle/Resources/public/js/*' %} - + {% endjavascripts %} .. code-block:: html+php @@ -68,7 +68,7 @@ To include JavaScript files, use the ``javascripts`` tag in any template: javascripts( array('@AppBundle/Resources/public/js/*') ) as $url): ?> - + .. note:: @@ -82,7 +82,7 @@ To include JavaScript files, use the ``javascripts`` tag in any template: {# ... #} {% block javascripts %} {% javascripts '@AppBundle/Resources/public/js/*' %} - + {% endjavascripts %} {% endblock %} {# ... #} @@ -548,7 +548,7 @@ command will automatically regenerate assets *as they change*: $ php app/console assetic:dump --watch Since running this command in the ``dev`` environment may generate a bunch -of files, it's usually a good idea to point your generated assets files to +of files, it's usually a good idea to point your generated asset files to some isolated directory (e.g. ``/js/compiled``), to keep things organized: .. configuration-block:: From 7c9c7ad9082227ca47d555c620e7a228acd6b376 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Thu, 15 Jan 2015 09:07:55 +0200 Subject: [PATCH 10/20] Update apply_to_option.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/assetic/apply_to_option.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cookbook/assetic/apply_to_option.rst b/cookbook/assetic/apply_to_option.rst index 4c080691f03..eedc6e8e7af 100644 --- a/cookbook/assetic/apply_to_option.rst +++ b/cookbook/assetic/apply_to_option.rst @@ -60,7 +60,7 @@ templates: .. code-block:: html+jinja {% javascripts '@AppBundle/Resources/public/js/example.coffee' filter='coffee' %} - + {% endjavascripts %} .. code-block:: html+php @@ -69,7 +69,7 @@ templates: array('@AppBundle/Resources/public/js/example.coffee'), array('coffee') ) as $url): ?> - + This is all that's needed to compile this CoffeeScript file and serve it @@ -87,7 +87,7 @@ You can also combine multiple CoffeeScript files into a single output file: {% javascripts '@AppBundle/Resources/public/js/example.coffee' '@AppBundle/Resources/public/js/another.coffee' filter='coffee' %} - + {% endjavascripts %} .. code-block:: html+php @@ -99,7 +99,7 @@ You can also combine multiple CoffeeScript files into a single output file: ), array('coffee') ) as $url): ?> - + Both the files will now be served up as a single file compiled into regular @@ -118,7 +118,7 @@ adding the JavaScript files to the files to be combined as above will not work as the regular JavaScript files will not survive the CoffeeScript compilation. This problem can be avoided by using the ``apply_to`` option in the config, -which allows you to specify that a filter should always be applied to particular +which allows you to specify which filter should always be applied to particular file extensions. In this case you can specify that the ``coffee`` filter is applied to all ``.coffee`` files: @@ -173,7 +173,7 @@ being run through the CoffeeScript filter): {% javascripts '@AppBundle/Resources/public/js/example.coffee' '@AppBundle/Resources/public/js/another.coffee' '@AppBundle/Resources/public/js/regular.js' %} - + {% endjavascripts %} .. code-block:: html+php @@ -185,5 +185,5 @@ being run through the CoffeeScript filter): '@AppBundle/Resources/public/js/regular.js', ) ) as $url): ?> - + From 07aefead065b6b31ec40fbe502e1b56744e97788 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Thu, 15 Jan 2015 09:43:45 +0200 Subject: [PATCH 11/20] Update error_pages.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/controller/error_pages.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cookbook/controller/error_pages.rst b/cookbook/controller/error_pages.rst index 3217c602017..2e28b98a9d6 100644 --- a/cookbook/controller/error_pages.rst +++ b/cookbook/controller/error_pages.rst @@ -187,8 +187,10 @@ to point to it. + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/twig + http://symfony.com/schema/dic/twig/twig-1.0.xsd"> AppBundle:Exception:showException From 80fc6654e372c1a6b703e43699527924102723b0 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Fri, 16 Jan 2015 09:27:34 +0200 Subject: [PATCH 12/20] Update configuration_organization.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- .../configuration_organization.rst | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cookbook/configuration/configuration_organization.rst b/cookbook/configuration/configuration_organization.rst index 63bcd9704f0..62311e7c515 100644 --- a/cookbook/configuration/configuration_organization.rst +++ b/cookbook/configuration/configuration_organization.rst @@ -127,8 +127,10 @@ needed for the ``app/config/dev/config.yml`` file: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -237,8 +239,10 @@ format (``.yml``, ``.xml``, ``.php``, ``.ini``): + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -299,8 +303,10 @@ any other configuration file: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -340,8 +346,10 @@ doesn't exist: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> From ece390420486ea1a400725ca235f652b1c151bc1 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Fri, 16 Jan 2015 08:35:32 +0200 Subject: [PATCH 13/20] Update environments.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/configuration/environments.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index b658b16f360..751f5971ca1 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -107,9 +107,7 @@ activated by modifying the default value in the ``dev`` configuration file: - + .. code-block:: php @@ -309,7 +307,7 @@ should also create a front controller for it. Copy the ``web/app.php`` file to ``web/app_benchmark.php`` and edit the environment to be ``benchmark``:: // web/app_benchmark.php - + // ... // change just this line $kernel = new AppKernel('benchmark', false); From 5e7846e265a544923942a2360e74dce3ce81909a Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Fri, 16 Jan 2015 09:50:25 +0200 Subject: [PATCH 14/20] Update spool.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/email/spool.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cookbook/email/spool.rst b/cookbook/email/spool.rst index 9210787160d..cf8ccce2c9d 100644 --- a/cookbook/email/spool.rst +++ b/cookbook/email/spool.rst @@ -38,7 +38,8 @@ swiftmailer with the memory option, use the following configuration: @@ -49,7 +50,7 @@ swiftmailer with the memory option, use the following configuration: // app/config/config.php $container->loadFromExtension('swiftmailer', array( - ..., + // ... 'spool' => array('type' => 'memory') )); @@ -75,7 +76,8 @@ In order to use the spool with a file, use the following configuration: @@ -99,7 +101,7 @@ In order to use the spool with a file, use the following configuration: .. tip:: If you want to store the spool somewhere with your project directory, - remember that you can use the `%kernel.root_dir%` parameter to reference + remember that you can use the ``%kernel.root_dir%`` parameter to reference the project's root: .. code-block:: yaml From 2980cad1f621c4bc898aa86d4be3e215a1c97b40 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Fri, 16 Jan 2015 09:43:09 +0200 Subject: [PATCH 15/20] Update cloud.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/email/cloud.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cookbook/email/cloud.rst b/cookbook/email/cloud.rst index f225b220a69..9b3677094c3 100644 --- a/cookbook/email/cloud.rst +++ b/cookbook/email/cloud.rst @@ -46,8 +46,10 @@ and complete the configuration with the provided ``username`` and ``password``: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/swiftmailer + http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd"> Date: Fri, 16 Jan 2015 09:39:34 +0200 Subject: [PATCH 16/20] Update gmail.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/email/gmail.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cookbook/email/gmail.rst b/cookbook/email/gmail.rst index 1565dc00c28..6a64a82e1ea 100644 --- a/cookbook/email/gmail.rst +++ b/cookbook/email/gmail.rst @@ -33,8 +33,10 @@ In the development configuration file, change the ``transport`` setting to + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/swiftmailer + http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd"> Date: Sun, 18 Jan 2015 09:35:28 +0200 Subject: [PATCH 17/20] Remove horizontal scrollbar | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- cookbook/logging/monolog.rst | 64 +++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/cookbook/logging/monolog.rst b/cookbook/logging/monolog.rst index ddd94f11b73..e50c520159d 100644 --- a/cookbook/logging/monolog.rst +++ b/cookbook/logging/monolog.rst @@ -84,8 +84,10 @@ allows you to log the messages in several ways easily. + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/monolog + http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"> + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/monolog + http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"> @@ -301,15 +305,21 @@ using a processor. + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/monolog + http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"> - + + [%%datetime%%] [%%extra.token%%] %%channel%%.%%level_name%%: %%message%% - + + @@ -330,11 +340,17 @@ using a processor. // app/config/config.php $container - ->register('monolog.formatter.session_request', 'Monolog\Formatter\LineFormatter') + ->register( + 'monolog.formatter.session_request', + 'Monolog\Formatter\LineFormatter' + ) ->addArgument('[%%datetime%%] [%%extra.token%%] %%channel%%.%%level_name%%: %%message%%\n'); $container - ->register('monolog.processor.session_request', 'Acme\MyBundle\SessionRequestProcessor') + ->register( + 'monolog.processor.session_request', + 'Acme\MyBundle\SessionRequestProcessor' + ) ->addArgument(new Reference('session')) ->addTag('monolog.processor', array('method' => 'processRecord')); @@ -383,10 +399,12 @@ the ``monolog.processor`` tag: xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/monolog - http://symfony.com/schema/dic/monolog/monolog-1.0.xsd" - > + http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"> + - + + @@ -397,7 +415,10 @@ the ``monolog.processor`` tag: // app/config/config.php $container - ->register('monolog.processor.session_request', 'Acme\MyBundle\SessionRequestProcessor') + ->register( + 'monolog.processor.session_request', + 'Acme\MyBundle\SessionRequestProcessor' + ) ->addArgument(new Reference('session')) ->addTag('monolog.processor', array('method' => 'processRecord', 'handler' => 'main')); @@ -429,10 +450,12 @@ the ``monolog.processor`` tag: xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/monolog - http://symfony.com/schema/dic/monolog/monolog-1.0.xsd" - > + http://symfony.com/schema/dic/monolog/monolog-1.0.xsd"> + - + + @@ -443,7 +466,10 @@ the ``monolog.processor`` tag: // app/config/config.php $container - ->register('monolog.processor.session_request', 'Acme\MyBundle\SessionRequestProcessor') + ->register( + 'monolog.processor.session_request', + 'Acme\MyBundle\SessionRequestProcessor' + ) ->addArgument(new Reference('session')) ->addTag('monolog.processor', array('method' => 'processRecord', 'channel' => 'main')); From f361c8771e20499cfac1353ff376896489cf8714 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Sat, 17 Jan 2015 00:27:52 +0100 Subject: [PATCH 18/20] Removed literals for bundle names --- best_practices/business-logic.rst | 8 ++-- best_practices/controllers.rst | 4 +- best_practices/creating-the-project.rst | 22 +++++----- book/controller.rst | 10 ++--- book/doctrine.rst | 2 +- book/page_creation.rst | 41 ++++++++++--------- book/propel.rst | 6 +-- book/service_container.rst | 13 +++--- book/templating.rst | 24 +++++------ components/console/helpers/dialoghelper.rst | 2 +- cookbook/assetic/asset_management.rst | 2 +- cookbook/assetic/uglifyjs.rst | 6 +-- cookbook/assetic/yuicompressor.rst | 6 +-- cookbook/bundles/best_practices.rst | 3 +- cookbook/bundles/extension.rst | 4 +- cookbook/bundles/prepend_extension.rst | 6 +-- .../doctrine/multiple_entity_managers.rst | 6 +-- cookbook/doctrine/reverse_engineering.rst | 5 +-- cookbook/profiler/data_collector.rst | 2 +- cookbook/security/entity_provider.rst | 8 ++-- quick_tour/the_architecture.rst | 6 +-- reference/configuration/doctrine.rst | 2 +- reference/constraints/UniqueEntity.rst | 2 +- 23 files changed, 94 insertions(+), 96 deletions(-) diff --git a/best_practices/business-logic.rst b/best_practices/business-logic.rst index 3799e7c0f83..9ddb6c5aa00 100644 --- a/best_practices/business-logic.rst +++ b/best_practices/business-logic.rst @@ -10,7 +10,7 @@ your app that's not specific to the framework (e.g. routing and controllers). Domain classes, Doctrine entities and regular PHP classes that are used as services are good examples of business logic. -For most projects, you should store everything inside the ``AppBundle``. +For most projects, you should store everything inside the AppBundle. Inside here, you can create whatever directories you want to organize things: .. code-block:: text @@ -45,7 +45,7 @@ and put things there: .. tip:: - The recommended approach of using the ``AppBundle`` directory is for + The recommended approach of using the ``AppBundle/`` directory is for simplicity. If you're advanced enough to know what needs to live in a bundle and what can live outside of one, then feel free to do that. @@ -166,8 +166,8 @@ library or strategy you want for this. In practice, many Symfony applications rely on the independent `Doctrine project`_ to define their model using entities and repositories. -Just like with business logic, we recommend storing Doctrine entities in -the ``AppBundle`` +Just like with business logic, we recommend storing Doctrine entities in the +AppBundle. The three entities defined by our sample blog application are a good example: diff --git a/best_practices/controllers.rst b/best_practices/controllers.rst index 31c4ae09438..a31db8e21c6 100644 --- a/best_practices/controllers.rst +++ b/best_practices/controllers.rst @@ -13,8 +13,8 @@ into a service. .. best-practice:: - Make your controller extend the ``FrameworkBundle`` base Controller and - use annotations to configure routing, caching and security whenever possible. + Make your controller extend the FrameworkBundle base controller and use + annotations to configure routing, caching and security whenever possible. Coupling the controllers to the underlying framework allows you to leverage all of its features and increases your productivity. diff --git a/best_practices/creating-the-project.rst b/best_practices/creating-the-project.rst index 42dca76c3da..d4eed5062f5 100644 --- a/best_practices/creating-the-project.rst +++ b/best_practices/creating-the-project.rst @@ -109,26 +109,26 @@ Application Bundles When Symfony 2.0 was released, most developers naturally adopted the symfony 1.x way of dividing applications into logical modules. That's why many Symfony -apps use bundles to divide their code into logical features: ``UserBundle``, -``ProductBundle``, ``InvoiceBundle``, etc. +apps use bundles to divide their code into logical features: UserBundle, +ProductBundle, InvoiceBundle, etc. But a bundle is *meant* to be something that can be reused as a stand-alone -piece of software. If ``UserBundle`` cannot be used *"as is"* in other Symfony -apps, then it shouldn't be its own bundle. Moreover ``InvoiceBundle`` depends -on ``ProductBundle``, then there's no advantage to having two separate bundles. +piece of software. If UserBundle cannot be used *"as is"* in other Symfony +apps, then it shouldn't be its own bundle. Moreover InvoiceBundle depends on +ProductBundle, then there's no advantage to having two separate bundles. .. best-practice:: - Create only one bundle called ``AppBundle`` for your application logic + Create only one bundle called AppBundle for your application logic -Implementing a single ``AppBundle`` bundle in your projects will make your code +Implementing a single AppBundle bundle in your projects will make your code more concise and easier to understand. Starting in Symfony 2.6, the official -Symfony documentation uses the ``AppBundle`` name. +Symfony documentation uses the AppBundle name. .. note:: - There is no need to prefix the ``AppBundle`` with your own vendor (e.g. - ``AcmeAppBundle``), because this application bundle is never going to be + There is no need to prefix the AppBundle with your own vendor (e.g. + AcmeAppBundle), because this application bundle is never going to be shared. All in all, this is the typical directory structure of a Symfony application @@ -152,7 +152,7 @@ that follows these best practices: .. tip:: - If your Symfony installation doesn't come with a pre-generated ``AppBundle``, + If your Symfony installation doesn't come with a pre-generated AppBundle, you can generate it by hand executing this command: .. code-block:: bash diff --git a/book/controller.rst b/book/controller.rst index c7cccc810db..c061ad8c063 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -228,9 +228,9 @@ Simple, right? Route Parameters as Controller Arguments ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You already know that the route points to the ``HelloController::indexAction()`` method -that lives inside ``AppBundle``. What's more interesting is the argument -that is passed to that method:: +You already know that the route points to the +``HelloController::indexAction()`` method that lives inside AppBundle. What's +more interesting is the argument that is passed to that method:: // src/AppBundle/Controller/HelloController.php // ... @@ -768,8 +768,8 @@ object that's returned from *that* controller:: Notice that the ``forward()`` method uses a special string representation of the controller (see :ref:`controller-string-syntax`). In this case, the target controller function will be ``SomethingController::fancyAction()`` -inside the ``AppBundle``. The array passed to the method becomes the arguments -on the resulting controller. This same idea is used when embedding controllers +inside the AppBundle. The array passed to the method becomes the arguments on +the resulting controller. This same idea is used when embedding controllers into templates (see :ref:`templating-embedding-controller`). The target controller method would look something like this:: diff --git a/book/doctrine.rst b/book/doctrine.rst index 0f3f62086d0..a4a96f5e125 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -193,7 +193,7 @@ Creating an Entity Class Suppose you're building an application where products need to be displayed. Without even thinking about Doctrine or databases, you already know that you need a ``Product`` object to represent those products. Create this class -inside the ``Entity`` directory of your ``AppBundle``:: +inside the ``Entity`` directory of your AppBundle:: // src/AppBundle/Entity/Product.php namespace AppBundle\Entity; diff --git a/book/page_creation.rst b/book/page_creation.rst index ac23536b46c..3d050051612 100644 --- a/book/page_creation.rst +++ b/book/page_creation.rst @@ -101,12 +101,12 @@ to a specific feature, including PHP classes, configuration, and even stylesheet and JavaScript files (see :ref:`page-creation-bundles`). Depending on the way you installed Symfony, you may already have a bundle called -``AcmeDemoBundle``. Browse the ``src/`` directory of your project and check +AcmeDemoBundle. Browse the ``src/`` directory of your project and check if there is a ``DemoBundle/`` directory inside an ``Acme/`` directory. If those directories already exist, skip the rest of this section and go directly to create the route. -To create a bundle called ``AcmeDemoBundle`` (a play bundle that you'll +To create a bundle called AcmeDemoBundle (a play bundle that you'll build in this chapter), run the following command and follow the on-screen instructions (use all the default options): @@ -140,8 +140,8 @@ By default, the routing configuration file in a Symfony application is located at ``app/config/routing.yml``. Like all configuration in Symfony, you can also choose to use XML or PHP out of the box to configure routes. -If you look at the main routing file, you'll see that Symfony already added -an entry when you generated the ``AcmeDemoBundle``: +If you look at the main routing file, you'll see that Symfony already added an +entry when you generated the AcmeDemoBundle: .. configuration-block:: @@ -181,9 +181,10 @@ an entry when you generated the ``AcmeDemoBundle``: This entry is pretty basic: it tells Symfony to load routing configuration from the ``Resources/config/routing.yml`` (``routing.xml`` or ``routing.php`` -in the XML and PHP code example respectively) file that lives inside the ``AcmeDemoBundle``. -This means that you place routing configuration directly in ``app/config/routing.yml`` -or organize your routes throughout your application, and import them from here. +in the XML and PHP code example respectively) file that lives inside the +AcmeDemoBundle. This means that you place routing configuration directly in +``app/config/routing.yml`` or organize your routes throughout your application, +and import them from here. .. note:: @@ -255,7 +256,7 @@ that controller. The controller - ``AcmeDemoBundle:Random:index`` is the *logical* name of the controller, and it maps to the ``indexAction`` method of a PHP class called ``Acme\DemoBundle\Controller\RandomController``. Start by creating this -file inside your ``AcmeDemoBundle``:: +file inside your AcmeDemoBundle:: // src/Acme/DemoBundle/Controller/RandomController.php namespace Acme\DemoBundle\Controller; @@ -388,7 +389,7 @@ location using the following convention. **/path/to/BundleName**/Resources/views/**ControllerName**/**TemplateName** -In this case, ``AcmeDemoBundle`` is the bundle name, ``Random`` is the +In this case, AcmeDemoBundle is the bundle name, ``Random`` is the controller, and ``index.html.twig`` the template: .. configuration-block:: @@ -636,7 +637,7 @@ in your application and to optimize them the way you want. to the organization and best practices of :doc:`bundles `. A bundle is simply a structured set of files within a directory that implement -a single feature. You might create a ``BlogBundle``, a ``ForumBundle`` or +a single feature. You might create a BlogBundle, a ForumBundle or a bundle for user management (many of these exist already as open source bundles). Each directory contains everything related to that feature, including PHP files, templates, stylesheets, JavaScripts, tests and anything else. @@ -685,13 +686,13 @@ The Symfony Standard Edition comes with a handy task that creates a fully-functi bundle for you. Of course, creating a bundle by hand is pretty easy as well. To show you how simple the bundle system is, create a new bundle called -``AcmeTestBundle`` and enable it. +AcmeTestBundle and enable it. .. tip:: The ``Acme`` portion is just a dummy name that should be replaced by - some "vendor" name that represents you or your organization (e.g. ``ABCTestBundle`` - for some company named ``ABC``). + some "vendor" name that represents you or your organization (e.g. + ABCTestBundle for some company named ``ABC``). Start by creating a ``src/Acme/TestBundle/`` directory and adding a new file called ``AcmeTestBundle.php``:: @@ -707,9 +708,10 @@ called ``AcmeTestBundle.php``:: .. tip:: - The name ``AcmeTestBundle`` follows the standard :ref:`Bundle naming conventions `. - You could also choose to shorten the name of the bundle to simply ``TestBundle`` - by naming this class ``TestBundle`` (and naming the file ``TestBundle.php``). + The name AcmeTestBundle follows the standard + :ref:`Bundle naming conventions `. You could + also choose to shorten the name of the bundle to simply TestBundle by naming + this class TestBundle (and naming the file ``TestBundle.php``). This empty class is the only piece you need to create the new bundle. Though commonly empty, this class is powerful and can be used to customize the behavior @@ -730,8 +732,7 @@ Now that you've created the bundle, enable it via the ``AppKernel`` class:: return $bundles; } -And while it doesn't do anything yet, ``AcmeTestBundle`` is now ready to -be used. +And while it doesn't do anything yet, AcmeTestBundle is now ready to be used. And as easy as this is, Symfony also provides a command-line interface for generating a basic bundle skeleton: @@ -755,8 +756,8 @@ Bundle Directory Structure The directory structure of a bundle is simple and flexible. By default, the bundle system follows a set of conventions that help to keep code consistent -between all Symfony bundles. Take a look at ``AcmeDemoBundle``, as it contains -some of the most common elements of a bundle: +between all Symfony bundles. Take a look at AcmeDemoBundle, as it contains some +of the most common elements of a bundle: ``Controller/`` Contains the controllers of the bundle (e.g. ``RandomController.php``). diff --git a/book/propel.rst b/book/propel.rst index 7d5f919593e..9ff589afb04 100644 --- a/book/propel.rst +++ b/book/propel.rst @@ -18,7 +18,7 @@ persist it to the database and fetch it back out. .. sidebar:: Code along with the Example If you want to follow along with the example in this chapter, create an - ``AcmeStoreBundle`` via: + AcmeStoreBundle via: .. code-block:: bash @@ -86,7 +86,7 @@ generated by Propel contain some business logic. Suppose you're building an application where products need to be displayed. First, create a ``schema.xml`` file inside the ``Resources/config`` directory -of your ``AcmeStoreBundle``: +of your AcmeStoreBundle: .. code-block:: xml @@ -129,7 +129,7 @@ After creating your ``schema.xml``, generate your model from it by running: $ php app/console propel:model:build This generates each model class to quickly develop your application in the -``Model/`` directory of the ``AcmeStoreBundle`` bundle. +``Model/`` directory of the AcmeStoreBundle bundle. Creating the Database Tables/Schema ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/book/service_container.rst b/book/service_container.rst index fef11d05fda..226271375cb 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -333,12 +333,12 @@ Importing Configuration with ``imports`` So far, you've placed your ``my_mailer`` service container definition directly in the application configuration file (e.g. ``app/config/config.yml``). Of -course, since the ``Mailer`` class itself lives inside the ``AcmeHelloBundle``, -it makes more sense to put the ``my_mailer`` container definition inside the +course, since the ``Mailer`` class itself lives inside the AcmeHelloBundle, it +makes more sense to put the ``my_mailer`` container definition inside the bundle as well. First, move the ``my_mailer`` container definition into a new container resource -file inside ``AcmeHelloBundle``. If the ``Resources`` or ``Resources/config`` +file inside AcmeHelloBundle. If the ``Resources`` or ``Resources/config`` directories don't exist, create them. .. configuration-block:: @@ -423,10 +423,9 @@ configuration. The ``imports`` directive allows your application to include service container configuration resources from any other location (most commonly from bundles). The ``resource`` location, for files, is the absolute path to the resource -file. The special ``@AcmeHello`` syntax resolves the directory path of -the ``AcmeHelloBundle`` bundle. This helps you specify the path to the resource -without worrying later if you move the ``AcmeHelloBundle`` to a different -directory. +file. The special ``@AcmeHello`` syntax resolves the directory path of the +AcmeHelloBundle bundle. This helps you specify the path to the resource without +worrying later if you move the AcmeHelloBundle to a different directory. .. index:: single: Service Container; Extension configuration diff --git a/book/templating.rst b/book/templating.rst index 4b003e8bad6..0e00d61581f 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -415,8 +415,8 @@ templates, each which lives in a specific location: template for a specific page. The three parts of the string, each separated by a colon (``:``), mean the following: - * ``AcmeBlogBundle``: (*bundle*) the template lives inside the - ``AcmeBlogBundle`` (e.g. ``src/Acme/BlogBundle``); + * ``AcmeBlogBundle``: (*bundle*) the template lives inside the AcmeBlogBundle + (e.g. ``src/Acme/BlogBundle``); * ``Blog``: (*directory*) indicates that the template lives inside the ``Blog`` subdirectory of ``Resources/views``; @@ -424,18 +424,18 @@ templates, each which lives in a specific location: * ``index.html.twig``: (*filename*) the actual name of the file is ``index.html.twig``. - Assuming that the ``AcmeBlogBundle`` lives at ``src/Acme/BlogBundle``, the + Assuming that the AcmeBlogBundle lives at ``src/Acme/BlogBundle``, the final path to the layout would be ``src/Acme/BlogBundle/Resources/views/Blog/index.html.twig``. * ``AcmeBlogBundle::layout.html.twig``: This syntax refers to a base template - that's specific to the ``AcmeBlogBundle``. Since the middle, "directory", - portion is missing (e.g. ``Blog``), the template lives at - ``Resources/views/layout.html.twig`` inside ``AcmeBlogBundle``. - Yes, there are 2 colons in the middle of the string when the "controller" - subdirectory part is missing. + that's specific to the AcmeBlogBundle. Since the middle, "directory", portion + is missing (e.g. ``Blog``), the template lives at + ``Resources/views/layout.html.twig`` inside AcmeBlogBundle. Yes, there are 2 + colons in the middle of the string when the "controller" subdirectory part is + missing. In the :ref:`overriding-bundle-templates` section, you'll find out how each -template living inside the ``AcmeBlogBundle``, for example, can be overridden +template living inside the AcmeBlogBundle, for example, can be overridden by placing a template of the same name in the ``app/Resources/AcmeBlogBundle/views/`` directory. This gives the power to override templates from any vendor bundle. @@ -1247,10 +1247,10 @@ bundles (see `KnpBundles.com`_) for a large number of different features. Once you use a third-party bundle, you'll likely need to override and customize one or more of its templates. -Suppose you've installed the imaginary open-source ``AcmeBlogBundle`` in your +Suppose you've installed the imaginary open-source AcmeBlogBundle in your project. And while you're really happy with everything, you want to override the blog "list" page to customize the markup specifically for your application. -By digging into the ``Blog`` controller of the ``AcmeBlogBundle``, you find the +By digging into the ``Blog`` controller of the AcmeBlogBundle, you find the following:: public function indexAction() @@ -1281,7 +1281,7 @@ to create it). You're now free to customize the template. cache (``php app/console cache:clear``), even if you are in debug mode. This logic also applies to base bundle templates. Suppose also that each -template in ``AcmeBlogBundle`` inherits from a base template called +template in AcmeBlogBundle inherits from a base template called ``AcmeBlogBundle::layout.html.twig``. Just as before, Symfony will look in the following two places for the template: diff --git a/components/console/helpers/dialoghelper.rst b/components/console/helpers/dialoghelper.rst index 96c5c880d09..3ec20a601bd 100644 --- a/components/console/helpers/dialoghelper.rst +++ b/components/console/helpers/dialoghelper.rst @@ -54,7 +54,7 @@ if you want to know a bundle name, you can add this to your command:: The user will be asked "Please enter the name of the bundle". They can type some name which will be returned by the :method:`Symfony\\Component\\Console\\Helper\\DialogHelper::ask` method. -If they leave it empty, the default value (``AcmeDemoBundle`` here) is returned. +If they leave it empty, the default value (AcmeDemoBundle here) is returned. Autocompletion ~~~~~~~~~~~~~~ diff --git a/cookbook/assetic/asset_management.rst b/cookbook/assetic/asset_management.rst index 785e239b1a0..278635ebf38 100644 --- a/cookbook/assetic/asset_management.rst +++ b/cookbook/assetic/asset_management.rst @@ -92,7 +92,7 @@ To include JavaScript files, use the ``javascripts`` tag in any template: You can also include CSS Stylesheets: see :ref:`cookbook-assetic-including-css`. In this example, all of the files in the ``Resources/public/js/`` directory -of the ``AppBundle`` will be loaded and served from a different location. +of the AppBundle will be loaded and served from a different location. The actual rendered tag might simply look like: .. code-block:: html diff --git a/cookbook/assetic/uglifyjs.rst b/cookbook/assetic/uglifyjs.rst index a028c50e7b7..8b0ddd66028 100644 --- a/cookbook/assetic/uglifyjs.rst +++ b/cookbook/assetic/uglifyjs.rst @@ -176,9 +176,9 @@ your assets are a part of the view layer, this work is done in your templates: .. note:: - The above example assumes that you have a bundle called ``AppBundle`` - and your JavaScript files are in the ``Resources/public/js`` directory under - your bundle. This isn't important however - you can include your JavaScript + The above example assumes that you have a bundle called AppBundle and your + JavaScript files are in the ``Resources/public/js`` directory under your + bundle. This isn't important however - you can include your JavaScript files no matter where they are. With the addition of the ``uglifyjs2`` filter to the asset tags above, you diff --git a/cookbook/assetic/yuicompressor.rst b/cookbook/assetic/yuicompressor.rst index 7e3671fa2fb..356b67b6071 100644 --- a/cookbook/assetic/yuicompressor.rst +++ b/cookbook/assetic/yuicompressor.rst @@ -106,9 +106,9 @@ the view layer, this work is done in your templates: .. note:: - The above example assumes that you have a bundle called ``AppBundle`` - and your JavaScript files are in the ``Resources/public/js`` directory under - your bundle. This isn't important however - you can include your JavaScript + The above example assumes that you have a bundle called AppBundle and your + JavaScript files are in the ``Resources/public/js`` directory under your + bundle. This isn't important however - you can include your JavaScript files no matter where they are. With the addition of the ``yui_js`` filter to the asset tags above, you should diff --git a/cookbook/bundles/best_practices.rst b/cookbook/bundles/best_practices.rst index 21947295b08..c580a46674a 100644 --- a/cookbook/bundles/best_practices.rst +++ b/cookbook/bundles/best_practices.rst @@ -80,8 +80,7 @@ examples). Directory Structure ------------------- -The basic directory structure of a ``HelloBundle`` bundle must read as -follows: +The basic directory structure of a HelloBundle must read as follows: .. code-block:: text diff --git a/cookbook/bundles/extension.rst b/cookbook/bundles/extension.rst index bdaf74570a6..aa2c5be8a35 100644 --- a/cookbook/bundles/extension.rst +++ b/cookbook/bundles/extension.rst @@ -23,8 +23,8 @@ following conventions: * It has to live in the ``DependencyInjection`` namespace of the bundle; * The name is equal to the bundle name with the ``Bundle`` suffix replaced by - ``Extension`` (e.g. the Extension class of ``AppBundle`` would be called - ``AppExtension`` and the one for ``AcmeHelloBundle`` would be called + ``Extension`` (e.g. the Extension class of the AppBundle would be called + ``AppExtension`` and the one for AcmeHelloBundle would be called ``AcmeHelloExtension``). The Extension class should implement the diff --git a/cookbook/bundles/prepend_extension.rst b/cookbook/bundles/prepend_extension.rst index 4c5cb7364fc..06e93990e6f 100644 --- a/cookbook/bundles/prepend_extension.rst +++ b/cookbook/bundles/prepend_extension.rst @@ -90,9 +90,9 @@ in case a specific other bundle is not registered:: } } -The above would be the equivalent of writing the following into the ``app/config/config.yml`` -in case ``AcmeGoodbyeBundle`` is not registered and the ``entity_manager_name`` setting -for ``acme_hello`` is set to ``non_default``: +The above would be the equivalent of writing the following into the +``app/config/config.yml`` in case AcmeGoodbyeBundle is not registered and the +``entity_manager_name`` setting for ``acme_hello`` is set to ``non_default``: .. configuration-block:: diff --git a/cookbook/doctrine/multiple_entity_managers.rst b/cookbook/doctrine/multiple_entity_managers.rst index ce2a3f685c6..5434d847365 100644 --- a/cookbook/doctrine/multiple_entity_managers.rst +++ b/cookbook/doctrine/multiple_entity_managers.rst @@ -150,9 +150,9 @@ The following configuration code shows how you can configure two entity managers In this case, you've defined two entity managers and called them ``default`` and ``customer``. The ``default`` entity manager manages entities in the -``AppBundle`` and ``AcmeStoreBundle``, while the ``customer`` entity -manager manages entities in the ``AcmeCustomerBundle``. You've also defined -two connections, one for each entity manager. +AppBundle and AcmeStoreBundle, while the ``customer`` entity manager manages +entities in the AcmeCustomerBundle. You've also defined two connections, one +for each entity manager. .. note:: diff --git a/cookbook/doctrine/reverse_engineering.rst b/cookbook/doctrine/reverse_engineering.rst index b5078d4aa44..dd50a6be9c2 100644 --- a/cookbook/doctrine/reverse_engineering.rst +++ b/cookbook/doctrine/reverse_engineering.rst @@ -49,9 +49,8 @@ to a post record thanks to a foreign key constraint. Before diving into the recipe, be sure your database connection parameters are correctly setup in the ``app/config/parameters.yml`` file (or wherever your database configuration is kept) and that you have initialized a bundle that -will host your future entity class. In this tutorial it's assumed that -an ``AcmeBlogBundle`` exists and is located under the ``src/Acme/BlogBundle`` -folder. +will host your future entity class. In this tutorial it's assumed that an +AcmeBlogBundle exists and is located under the ``src/Acme/BlogBundle`` folder. The first step towards building entity classes from an existing database is to ask Doctrine to introspect the database and generate the corresponding diff --git a/cookbook/profiler/data_collector.rst b/cookbook/profiler/data_collector.rst index 6c02639f197..db3a86bfdab 100644 --- a/cookbook/profiler/data_collector.rst +++ b/cookbook/profiler/data_collector.rst @@ -152,7 +152,7 @@ All blocks have access to the ``collector`` object. To enable the template, add a ``template`` attribute to the ``data_collector`` tag in your configuration. For example, assuming your template is in some -``AcmeDebugBundle``: +AcmeDebugBundle: .. configuration-block:: diff --git a/cookbook/security/entity_provider.rst b/cookbook/security/entity_provider.rst index 144d7809f48..98df1da6a69 100644 --- a/cookbook/security/entity_provider.rst +++ b/cookbook/security/entity_provider.rst @@ -37,10 +37,10 @@ retrieve users from a database with custom conditions. The Data Model -------------- -For the purpose of this cookbook, the ``AcmeUserBundle`` bundle contains a -``User`` entity class with the following fields: ``id``, ``username``, -``password``, ``email`` and ``isActive``. The ``isActive`` field tells whether -or not the user account is active. +For the purpose of this cookbook, the AcmeUserBundle bundle contains a ``User`` +entity class with the following fields: ``id``, ``username``, ``password``, +``email`` and ``isActive``. The ``isActive`` field tells whether or not the +user account is active. To make it shorter, the getter and setter methods for each have been removed to focus on the most important methods that come from the diff --git a/quick_tour/the_architecture.rst b/quick_tour/the_architecture.rst index f8e947dae75..aa644328799 100644 --- a/quick_tour/the_architecture.rst +++ b/quick_tour/the_architecture.rst @@ -90,8 +90,8 @@ own bundles. It makes it easy to pick and choose which features to enable in your application and optimize them the way you want. And at the end of the day, your application code is just as *important* as the core framework itself. -Symfony already includes an ``AppBundle`` that you may use to start developing -your application. Then, if you need to split the application into reusable +Symfony already includes an AppBundle that you may use to start developing your +application. Then, if you need to split the application into reusable components, you can create your own bundles. Registering a Bundle @@ -99,7 +99,7 @@ Registering a Bundle An application is made up of bundles as defined in the ``registerBundles()`` method of the ``AppKernel`` class. Each bundle is a directory that contains -a single ``Bundle`` class that describes it:: +a single Bundle class that describes it:: // app/AppKernel.php public function registerBundles() diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 5a7afc42dca..d11044e632a 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -336,7 +336,7 @@ A common namespace prefix that all entities of this mapping share. This prefix should never conflict with prefixes of other defined mappings otherwise some of your entities cannot be found by Doctrine. This option defaults to the bundle namespace + ``Entity``, for example for an application bundle called -``AcmeHelloBundle`` prefix would be ``Acme\HelloBundle\Entity``. +AcmeHelloBundle prefix would be ``Acme\HelloBundle\Entity``. alias ..... diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index 98be847645f..c2dd5e0f439 100644 --- a/reference/constraints/UniqueEntity.rst +++ b/reference/constraints/UniqueEntity.rst @@ -23,7 +23,7 @@ using an email address that already exists in the system. Basic Usage ----------- -Suppose you have an ``AcmeUserBundle`` bundle with a ``User`` entity that has an +Suppose you have an AcmeUserBundle bundle with a ``User`` entity that has an ``email`` field. You can use the ``UniqueEntity`` constraint to guarantee that the ``email`` field remains unique between all of the constraints in your user table: From 430de15bd8e1f6426eca2d5e2f1b3cc44f5ea5db Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 16 Jan 2015 18:10:16 +0100 Subject: [PATCH 19/20] don't explain deprecated `getName()` method --- components/event_dispatcher/introduction.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/components/event_dispatcher/introduction.rst b/components/event_dispatcher/introduction.rst index 44db477789b..0d79e413eb2 100644 --- a/components/event_dispatcher/introduction.rst +++ b/components/event_dispatcher/introduction.rst @@ -626,22 +626,21 @@ and so on... Event Name Introspection ~~~~~~~~~~~~~~~~~~~~~~~~ -Since the ``EventDispatcher`` already knows the name of the event when dispatching -it, the event name is also injected into the -:class:`Symfony\\Component\\EventDispatcher\\Event` objects, making it available -to event listeners via the :method:`Symfony\\Component\\EventDispatcher\\Event::getName` -method. +.. versionadded:: 2.4 + Before Symfony 2.4, the event name and the event dispatcher had to be + requested from the ``Event`` instance. These methods are now deprecated. -The event name, (as with any other data in a custom event object) can be used as -part of the listener's processing logic:: +The ``EventDispatcher`` instance, as well as the name of the event that is +dispatched, are passed as arguments to the listener:: use Symfony\Component\EventDispatcher\Event; + use Symfony\Component\EventDispatcher\EventDispatcherInterface; class Foo { - public function myEventListener(Event $event) + public function myEventListener(Event $event, $eventName, EventDispatcherInterface $dispatcher) { - echo $event->getName(); + echo $eventName; } } From b624100a6d886905d4c63c74949ce03a2d805eb4 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 25 Jan 2015 16:08:57 -0500 Subject: [PATCH 20/20] Fixing bad `@AcmeHello` -> `@AcmeHelloBundle` --- book/service_container.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/service_container.rst b/book/service_container.rst index c6cbbd44805..83c47a709e1 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -423,9 +423,9 @@ configuration. The ``imports`` directive allows your application to include service container configuration resources from any other location (most commonly from bundles). The ``resource`` location, for files, is the absolute path to the resource -file. The special ``@AcmeHello`` syntax resolves the directory path of the -AcmeHelloBundle bundle. This helps you specify the path to the resource without -worrying later if you move the AcmeHelloBundle to a different directory. +file. The special ``@AcmeHelloBundle`` syntax resolves the directory path +of the AcmeHelloBundle bundle. This helps you specify the path to the resource +without worrying later if you move the AcmeHelloBundle to a different directory. .. index:: single: Service Container; Extension configuration