Skip to content

Facelift for book/routing - "Easy" level #2431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -1035,7 +1036,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
Expand All @@ -1054,6 +1055,19 @@ 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

Expand Down
5 changes: 5 additions & 0 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ 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``.

.. caution::

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:

Expand Down
1 change: 0 additions & 1 deletion components/dependency_injection/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cookbook/validation/custom_constraint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down