From b0a0e90d6eb4cd4b255259b513c4b066430ee567 Mon Sep 17 00:00:00 2001 From: Pavel Volokitin Date: Fri, 15 Mar 2013 01:18:00 +0600 Subject: [PATCH 01/10] Fix DomCrawler html dumping example. --- components/dom_crawler.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 517a3dbb98b..83a73f64b5b 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -190,7 +190,7 @@ and :phpclass:`DOMNode` objects: $html = ''; foreach ($crawler as $domElement) { - $html.= $domElement->ownerDocument->saveHTML(); + $html.= $domElement->ownerDocument->saveHTML($domElement); } Form and Link support From 9e27f46abf97960a755ee5f15b81bfa33fc94d4b Mon Sep 17 00:00:00 2001 From: Pavel Volokitin Date: Fri, 15 Mar 2013 03:16:42 +0600 Subject: [PATCH 02/10] Add missing space in DomCrawler example. --- components/dom_crawler.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 83a73f64b5b..4b122f6fc28 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -190,7 +190,7 @@ and :phpclass:`DOMNode` objects: $html = ''; foreach ($crawler as $domElement) { - $html.= $domElement->ownerDocument->saveHTML($domElement); + $html .= $domElement->ownerDocument->saveHTML($domElement); } Form and Link support From 43d206fdd3d6cbc4949aecba286443480a659ceb Mon Sep 17 00:00:00 2001 From: Christian Morgan Date: Fri, 15 Mar 2013 14:05:10 +0000 Subject: [PATCH 03/10] Fixed plural version of URLs where it was referred to as "URL's" --- book/routing.rst | 2 +- reference/configuration/framework.rst | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/book/routing.rst b/book/routing.rst index 5b857dc1340..83df5398ea9 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -476,7 +476,7 @@ Take a quick look at the routes that have been created so far: return $collection; Can you spot the problem? Notice that both routes have patterns that match -URL's that look like ``/blog/*``. The Symfony router will always choose the +URLs that look like ``/blog/*``. The Symfony router will always choose the **first** matching route it finds. In other words, the ``blog_show`` route will *never* be matched. Instead, a URL like ``/blog/my-blog-post`` will match the first route (``blog``) and return a nonsense value of ``my-blog-post`` diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 52382977696..deb67595a36 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -162,16 +162,16 @@ assets_base_urls **default**: ``{ http: [], ssl: [] }`` -This option allows you to define base URL's to be used for assets referenced +This option allows you to define base URLs to be used for assets referenced from ``http`` and ``ssl`` (``https``) pages. A string value may be provided in -lieu of a single-element array. If multiple base URL's are provided, Symfony2 +lieu of a single-element array. If multiple base URLs are provided, Symfony2 will select one from the collection each time it generates an asset's path. For your convenience, ``assets_base_urls`` can be set directly with a string or array of strings, which will be automatically organized into collections of base -URL's for ``http`` and ``https`` requests. If a URL starts with ``https://`` or +URLs for ``http`` and ``https`` requests. If a URL starts with ``https://`` or is `protocol-relative`_ (i.e. starts with `//`) it will be added to both -collections. URL's starting with ``http://`` will only be added to the +collections. URLs starting with ``http://`` will only be added to the ``http`` collection. .. _ref-framework-assets-version: From 8239b2f02e555183b0aafdd7225a56664631d642 Mon Sep 17 00:00:00 2001 From: Abdellatif Ait boudad Date: Sun, 17 Mar 2013 00:12:30 +0000 Subject: [PATCH 04/10] [Config][Normalization] added a tip about altered keys --- components/config/definition.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/config/definition.rst b/components/config/definition.rst index 77898e6b576..24003f1da01 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -325,6 +325,10 @@ The separator used in keys is typically ``_`` in Yaml and ``-`` in XML. For example, ``auto_connect`` in Yaml and ``auto-connect``. The normalization would make both of these ``auto_connect``. +.. tip:: + + The target key will not be altered if it's mixed like ``foo-bar_moo`` or if it already exists. + Another difference between Yaml and XML is in the way arrays of values may be represented. In Yaml you may have: From d773f2ee2e26c76da875dae1a206daef9f7d275e Mon Sep 17 00:00:00 2001 From: Abdellatif Ait boudad Date: Sun, 17 Mar 2013 12:14:57 +0000 Subject: [PATCH 05/10] replace block 'tip' to 'caution --- components/config/definition.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/config/definition.rst b/components/config/definition.rst index 24003f1da01..848fbc4dc0f 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -325,9 +325,10 @@ The separator used in keys is typically ``_`` in Yaml and ``-`` in XML. For example, ``auto_connect`` in Yaml and ``auto-connect``. The normalization would make both of these ``auto_connect``. -.. tip:: +.. caution:: - The target key will not be altered if it's mixed like ``foo-bar_moo`` or if it already exists. + The target key will not be altered if it's mixed like ``foo-bar_moo`` or if + it already exists. Another difference between Yaml and XML is in the way arrays of values may be represented. In Yaml you may have: From 1fea07ec81b7837bf269797c9ef62e49c2be9a2b Mon Sep 17 00:00:00 2001 From: Simone Fumagalli Date: Mon, 18 Mar 2013 18:00:28 +0100 Subject: [PATCH 06/10] Fixed a yaml configuration block --- cookbook/validation/custom_constraint.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/validation/custom_constraint.rst b/cookbook/validation/custom_constraint.rst index c906516dae8..e8f169b4c50 100644 --- a/cookbook/validation/custom_constraint.rst +++ b/cookbook/validation/custom_constraint.rst @@ -238,7 +238,7 @@ not to the property: # src/Acme/BlogBundle/Resources/config/validation.yml Acme\DemoBundle\Entity\AcmeEntity: constraints: - - ContainsAlphanumeric + ContainsAlphanumeric: ~ .. code-block:: php-annotations From 59dde0bccea97501caaea17580932a1edbe0e26e Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Tue, 19 Mar 2013 09:54:14 +0000 Subject: [PATCH 07/10] Removing an unused use statement from example --- components/dependency_injection/introduction.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/components/dependency_injection/introduction.rst b/components/dependency_injection/introduction.rst index 7ef0dcc34a1..e251dcd8740 100644 --- a/components/dependency_injection/introduction.rst +++ b/components/dependency_injection/introduction.rst @@ -153,7 +153,6 @@ You could then get your ``newsletter_manager`` service from the container like this:: use Symfony\Component\DependencyInjection\ContainerBuilder; - use Symfony\Component\DependencyInjection\Reference; $container = new ContainerBuilder(); From 9108c4bb495e38b5c5910e8be8ef13c2ff902c5f Mon Sep 17 00:00:00 2001 From: Abdellatif Ait boudad Date: Tue, 19 Mar 2013 22:01:53 +0000 Subject: [PATCH 08/10] Break the line after the first word crossing 72 chars --- components/config/definition.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/config/definition.rst b/components/config/definition.rst index 848fbc4dc0f..293da6b0b9b 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -327,8 +327,8 @@ make both of these ``auto_connect``. .. caution:: - The target key will not be altered if it's mixed like ``foo-bar_moo`` or if - it already exists. + The target key will not be altered if it's mixed like + ``foo-bar_moo`` or if it already exists. Another difference between Yaml and XML is in the way arrays of values may be represented. In Yaml you may have: From af59ad94e618cf040f64093e4eb72d657202e542 Mon Sep 17 00:00:00 2001 From: Kevin Weber Date: Sat, 30 Mar 2013 16:32:18 -0400 Subject: [PATCH 09/10] Well written page. Not much to add or clean. --- book/routing.rst | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/book/routing.rst b/book/routing.rst index 4b4844bec7f..b49f208be54 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -763,6 +763,7 @@ a slash. URLs matching this route might look like: * ``/articles/en/2010/my-post`` * ``/articles/fr/2010/my-post.rss`` +* ``/articles/en/2013/my-latest-post.html`` .. _book-routing-format-param: @@ -1014,11 +1015,12 @@ instead of simply ``/hello/{name}``: The string ``/admin`` will now be prepended to the pattern of each route loaded from the new routing resource. -.. tip:: +Annotations +~~~~~~~~~~~ - You can also define routes using annotations. See the - :doc:`FrameworkExtraBundle documentation` - to see how. +You can define your routes in your controllers by using annotations. See the +:doc:`FrameworkExtraBundle documentation` +to see how. .. index:: single: Routing; Debugging @@ -1035,7 +1037,7 @@ the command by running the following from the root of your project. $ php app/console router:debug -The command will print a helpful list of *all* the configured routes in +This command will print a helpful list of *all* the configured routes in your application: .. code-block:: text @@ -1054,6 +1056,18 @@ the route name after the command: $ php app/console router:debug article_show +Likewise, if you want to test whether a URL matches a given route, you can use the ``router:match`` console command. + +.. code-block:: bash + + $ php app/console router:match /blog/my-latest-post + +This command will print which route the URL matches. + +.. code-block:: text + + Route "blog_show" matches + .. index:: single: Routing; Generating URLs From 944c69043866beb6ae4108a1d12c01c623eaec15 Mon Sep 17 00:00:00 2001 From: Kevin Weber Date: Sun, 31 Mar 2013 10:23:47 -0400 Subject: [PATCH 10/10] Implemented suggestions by WouterJ. --- book/routing.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/book/routing.rst b/book/routing.rst index b49f208be54..d99fba042e5 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -1015,12 +1015,11 @@ instead of simply ``/hello/{name}``: The string ``/admin`` will now be prepended to the pattern of each route loaded from the new routing resource. -Annotations -~~~~~~~~~~~ +.. tip:: -You can define your routes in your controllers by using annotations. See the -:doc:`FrameworkExtraBundle documentation` -to see how. + You can also define routes using annotations. See the + :doc:`FrameworkExtraBundle documentation` + to see how. .. index:: single: Routing; Debugging @@ -1056,7 +1055,8 @@ the route name after the command: $ php app/console router:debug article_show -Likewise, if you want to test whether a URL matches a given route, you can use the ``router:match`` console command. +Likewise, if you want to test whether a URL matches a given route, you can +use the ``router:match`` console command: .. code-block:: bash