Skip to content

Fixed minor code examples issues #2045

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

Merged
merged 1 commit into from
Dec 19, 2012
Merged
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
2 changes: 1 addition & 1 deletion cookbook/bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ The end user can provide values in any configuration file:

.. code-block:: ini

; app/config/config.ini
; app/config/parameters.ini
[parameters]
acme_hello.email.from = fabien@example.com

Expand Down
18 changes: 9 additions & 9 deletions cookbook/configuration/external_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ The container also has support for setting PHP constants as parameters. To
take advantage of this feature, map the name of your constant to a parameter
key, and define the type as ``constant``.

.. code-block:: xml
.. code-block:: xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<parameters>
<parameter key="global.constant.value" type="constant">GLOBAL_CONSTANT</parameter>
<parameter key="my_class.constant.value" type="constant">My_Class::CONSTANT_NAME</parameter>
</parameters>
</container>
<parameters>
<parameter key="global.constant.value" type="constant">GLOBAL_CONSTANT</parameter>
<parameter key="my_class.constant.value" type="constant">My_Class::CONSTANT_NAME</parameter>
</parameters>
</container>

.. note::

Expand Down
3 changes: 2 additions & 1 deletion cookbook/form/form_collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ into new ``Tag`` objects and added to the ``tags`` property of the ``Task`` obje
and call ``$em->persist($tag)`` on each, you'll receive an error from
Doctrine:

A new entity was found through the relationship 'Acme\TaskBundle\Entity\Task#tags' that was not configured to cascade persist operations for entity...
A new entity was found through the relationship `Acme\TaskBundle\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
from the ``Task`` object to any related tags. To do this, add the ``cascade``
Expand Down
4 changes: 2 additions & 2 deletions cookbook/security/entity_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ for the purposes of this tutorial.
Below is an export of my ``User`` table from MySQL. For details on how to
create user records and encode their password, see :ref:`book-security-encoding-user-password`.

.. code-block:: text
.. code-block:: bash

mysql> select * from user;
$ mysql> select * from user;
+----+----------+----------------------------------+------------------------------------------+--------------------+-----------+
| id | username | salt | password | email | is_active |
+----+----------+----------------------------------+------------------------------------------+--------------------+-----------+
Expand Down
18 changes: 11 additions & 7 deletions cookbook/symfony1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ a bundle. With the help of a console command, the ``Resources/public/``
directory of each bundle is copied or symbolically-linked to the ``web/bundles/``
directory. This allows you to keep assets organized inside your bundle, but
still make them available to the public. To make sure that all bundles are
available, run the following command::
available, run the following command:

php app/console assets:install web
.. code-block:: bash

$ php app/console assets:install web

.. note::

Expand Down Expand Up @@ -185,16 +187,16 @@ Using the Console
In symfony1, the console is in the root directory of your project and is
called ``symfony``:

.. code-block:: text
.. code-block:: bash

php symfony
$ php symfony

In Symfony2, the console is now in the app sub-directory and is called
``console``:

.. code-block:: text
.. code-block:: bash

php app/console
$ php app/console

Applications
------------
Expand Down Expand Up @@ -262,7 +264,9 @@ In symfony1, the ``routing.yml`` and ``app.yml`` configuration files were
automatically loaded inside any plugin. In Symfony2, routing and application
configuration inside a bundle must be included manually. For example, to
include a routing resource from a bundle called ``AcmeDemoBundle``, you can
do the following::
do the following:

.. code-block:: yaml

# app/config/routing.yml
_hello:
Expand Down
7 changes: 6 additions & 1 deletion cookbook/testing/bootstrap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ with ``tests.bootstrap.php``:
.. code-block:: xml

<!-- app/phpunit.xml.dist -->
bootstrap = "tests.bootstrap.php"

<!-- ... -->
<phpunit
...
bootstrap = "tests.bootstrap.php"
>

Now, you can define in your ``phpunit.xml.dist`` file which environment you want the
cache to be cleared:
Expand Down
32 changes: 17 additions & 15 deletions reference/dic_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -580,26 +580,28 @@ Your custom loader's ``load`` method is responsible for returning a

Now, register your loader as a service and tag it with ``translation.loader``:

.. code-block:: yaml
.. configuration-block::

.. code-block:: yaml

services:
main.translation.my_custom_loader:
class: Acme\MainBundle\Translation\MyCustomLoader
tags:
- { name: translation.loader, alias: bin }
services:
main.translation.my_custom_loader:
class: Acme\MainBundle\Translation\MyCustomLoader
tags:
- { name: translation.loader, alias: bin }

.. code-block:: xml
.. code-block:: xml

<service id="main.translation.my_custom_loader" class="Acme\MainBundle\Translation\MyCustomLoader">
<tag name="translation.loader" alias="bin" />
</service>
<service id="main.translation.my_custom_loader" class="Acme\MainBundle\Translation\MyCustomLoader">
<tag name="translation.loader" alias="bin" />
</service>

.. code-block:: php
.. code-block:: php

$container
->register('main.translation.my_custom_loader', 'Acme\MainBundle\Translation\MyCustomLoader')
->addTag('translation.loader', array('alias' => 'bin'))
;
$container
->register('main.translation.my_custom_loader', 'Acme\MainBundle\Translation\MyCustomLoader')
->addTag('translation.loader', array('alias' => 'bin'))
;

The ``alias`` option is required and very important: it defines the file
"suffix" that will be used for the resource files that use this loader. For
Expand Down