Skip to content

Commit

Permalink
Changed to definition lists
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronofuentes committed Dec 17, 2014
1 parent 3649bdb commit dda1905
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 112 deletions.
50 changes: 30 additions & 20 deletions book/page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,17 @@ you'll know where to find and put different types of files and why.
Though entirely flexible, by default, each Symfony :term:`application` has
the same basic and recommended directory structure:

* ``app/``: This directory contains the application configuration;
``app/``
This directory contains the application configuration.

* ``src/``: All the project PHP code is stored under this directory;
``src/``
All the project PHP code is stored under this directory.

* ``vendor/``: Any vendor libraries are placed here by convention;
``vendor/``
Any vendor libraries are placed here by convention.

* ``web/``: This is the web root directory and contains any publicly accessible files;
``web/``
This is the web root directory and contains any publicly accessible files.

.. _the-web-directory:

Expand Down Expand Up @@ -554,11 +558,13 @@ needs to know about your application. You don't even need to worry about
these methods when starting - Symfony fills them in for you with sensible
defaults.

* ``registerBundles()``: Returns an array of all bundles needed to run the
application (see :ref:`page-creation-bundles`);
``registerBundles()``
Returns an array of all bundles needed to run the application (see
:ref:`page-creation-bundles`).

* ``registerContainerConfiguration()``: Loads the main application configuration
resource file (see the `Application Configuration`_ section).
``registerContainerConfiguration()``
Loads the main application configuration resource file (see the
`Application Configuration`_ section).

In day-to-day development, you'll mostly use the ``app/`` directory to modify
configuration and routing files in the ``app/config/`` directory (see
Expand Down Expand Up @@ -743,23 +749,27 @@ 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:

* ``Controller/`` contains the controllers of the bundle (e.g. ``RandomController.php``);
``Controller/``
Contains the controllers of the bundle (e.g. ``RandomController.php``).

* ``DependencyInjection/`` holds certain dependency injection extension classes,
which may import service configuration, register compiler passes or more
(this directory is not necessary);
``DependencyInjection/``
Holds certain dependency injection extension classes, which may import service
configuration, register compiler passes or more (this directory is not
necessary).

* ``Resources/config/`` houses configuration, including routing configuration
(e.g. ``routing.yml``);
``Resources/config/``
Houses configuration, including routing configuration (e.g. ``routing.yml``).

* ``Resources/views/`` holds templates organized by controller name (e.g.
``Hello/index.html.twig``);
``Resources/views/``
Holds templates organized by controller name (e.g. ``Hello/index.html.twig``).

* ``Resources/public/`` contains web assets (images, stylesheets, etc) and is
copied or symbolically linked into the project ``web/`` directory via
the ``assets:install`` console command;
``Resources/public/``
Contains web assets (images, stylesheets, etc) and is copied or symbolically
linked into the project ``web/`` directory via the ``assets:install`` console
command.

* ``Tests/`` holds all tests for the bundle.
``Tests/``
Holds all tests for the bundle.

A bundle can be as small or large as the feature it implements. It contains
only the files you need and nothing else.
Expand Down
24 changes: 16 additions & 8 deletions book/propel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -467,14 +467,22 @@ To add a hook, just add a new method to the object class::

Propel provides the following hooks:

* ``preInsert()`` code executed before insertion of a new object
* ``postInsert()`` code executed after insertion of a new object
* ``preUpdate()`` code executed before update of an existing object
* ``postUpdate()`` code executed after update of an existing object
* ``preSave()`` code executed before saving an object (new or existing)
* ``postSave()`` code executed after saving an object (new or existing)
* ``preDelete()`` code executed before deleting an object
* ``postDelete()`` code executed after deleting an object
``preInsert()``
Code executed before insertion of a new object.
``postInsert()``
Code executed after insertion of a new object.
``preUpdate()``
Code executed before update of an existing object.
``postUpdate()``
Code executed after update of an existing object.
``preSave()``
Code executed before saving an object (new or existing).
``postSave()``
Code executed after saving an object (new or existing).
``preDelete()``
Code executed before deleting an object.
``postDelete()``
Code executed after deleting an object.

Behaviors
---------
Expand Down
11 changes: 7 additions & 4 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1036,12 +1036,15 @@ As you've seen, each routing parameter or default value is eventually available
as an argument in the controller method. Additionally, there are three parameters
that are special: each adds a unique piece of functionality inside your application:

* ``_controller``: As you've seen, this parameter is used to determine which
controller is executed when the route is matched;
``_controller``
As you've seen, this parameter is used to determine which controller is
executed when the route is matched.

* ``_format``: Used to set the request format (:ref:`read more <book-routing-format-param>`);
``_format``
Used to set the request format (:ref:`read more <book-routing-format-param>`).

* ``_locale``: Used to set the locale on the request (:ref:`read more <book-translation-locale-url>`).
``_locale``
Used to set the locale on the request (:ref:`read more <book-translation-locale-url>`).

.. index::
single: Routing; Controllers
Expand Down
21 changes: 12 additions & 9 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,18 @@ to web designers and, in several ways, more powerful than PHP templates:

Twig defines three types of special syntax:

* ``{{ ... }}``: "Says something": prints a variable or the result of an
expression to the template;

* ``{% ... %}``: "Does something": a **tag** that controls the logic of the
template; it is used to execute statements such as for-loops for example.

* ``{# ... #}``: "Comment something": it's the equivalent of the PHP
``/* comment */`` syntax. It's used to add single or multi-line comments.
The content of the comments isn't included in the rendered pages.
``{{ ... }}``
"Says something": prints a variable or the result of an expression to the
template.

``{% ... %}``
"Does something": a **tag** that controls the logic of the template; it is
used to execute statements such as for-loops for example.

``{# ... #}``
"Comment something": it's the equivalent of the PHP ``/* comment */`` syntax.
It's used to add single or multi-line comments. The content of the comments
isn't included in the rendered pages.

Twig also contains **filters**, which modify content before being rendered.
The following makes the ``title`` variable all uppercase before rendering
Expand Down
47 changes: 22 additions & 25 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -525,31 +525,28 @@ selects the last one on the page, and then selects its immediate parent element:

Many other methods are also available:

+------------------------+----------------------------------------------------+
| Method | Description |
+========================+====================================================+
| ``filter('h1.title')`` | Nodes that match the CSS selector |
+------------------------+----------------------------------------------------+
| ``filterXpath('h1')`` | Nodes that match the XPath expression |
+------------------------+----------------------------------------------------+
| ``eq(1)`` | Node for the specified index |
+------------------------+----------------------------------------------------+
| ``first()`` | First node |
+------------------------+----------------------------------------------------+
| ``last()`` | Last node |
+------------------------+----------------------------------------------------+
| ``siblings()`` | Siblings |
+------------------------+----------------------------------------------------+
| ``nextAll()`` | All following siblings |
+------------------------+----------------------------------------------------+
| ``previousAll()`` | All preceding siblings |
+------------------------+----------------------------------------------------+
| ``parents()`` | Returns the parent nodes |
+------------------------+----------------------------------------------------+
| ``children()`` | Returns children nodes |
+------------------------+----------------------------------------------------+
| ``reduce($lambda)`` | Nodes for which the callable does not return false |
+------------------------+----------------------------------------------------+
``filter('h1.title')``
Nodes that match the CSS selector.
``filterXpath('h1')``
Nodes that match the XPath expression.
``eq(1)``
Node for the specified index.
``first()``
First node.
``last()``
Last node.
``siblings()``
Siblings.
``nextAll()``
All following siblings.
``previousAll()``
All preceding siblings.
``parents()``
Returns the parent nodes.
``children()``
Returns children nodes.
``reduce($lambda)``
Nodes for which the callable does not return false.

Since each of these methods returns a new ``Crawler`` instance, you can
narrow down your node selection by chaining the method calls::
Expand Down
64 changes: 32 additions & 32 deletions components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,47 +90,47 @@ instance (or a sub-class of), which is a data holder class:
All :class:`Symfony\\Component\\HttpFoundation\\ParameterBag` instances have
methods to retrieve and update its data:

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::all`: Returns
the parameters;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::all`
Returns the parameters.

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::keys`: Returns
the parameter keys;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::keys`
Returns the parameter keys.

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::replace`:
Replaces the current parameters by a new set;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::replace`
Replaces the current parameters by a new set.

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::add`: Adds
parameters;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::add`
Adds parameters.

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::get`: Returns a
parameter by name;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::get`
Returns a parameter by name.

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::set`: Sets a
parameter by name;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::set`
Sets a parameter by name.

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::has`: Returns
``true`` if the parameter is defined;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::has`
Returns ``true`` if the parameter is defined.

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::remove`: Removes
a parameter.
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::remove`
Removes a parameter.

The :class:`Symfony\\Component\\HttpFoundation\\ParameterBag` instance also
has some methods to filter the input values:

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::getAlpha`: Returns
the alphabetic characters of the parameter value;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::getAlpha`
Returns the alphabetic characters of the parameter value;

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::getAlnum`: Returns
the alphabetic characters and digits of the parameter value;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::getAlnum`
Returns the alphabetic characters and digits of the parameter value;

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::getDigits`: Returns
the digits of the parameter value;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::getDigits`
Returns the digits of the parameter value;

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::getInt`: Returns the
parameter value converted to integer;
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::getInt`
Returns the parameter value converted to integer;

* :method:`Symfony\\Component\\HttpFoundation\\ParameterBag::filter`: Filters the
parameter by using the PHP :phpfunction:`filter_var` function.
:method:`Symfony\\Component\\HttpFoundation\\ParameterBag::filter`
Filters the parameter by using the PHP :phpfunction:`filter_var` function.

All getters takes up to three arguments: the first one is the parameter name
and the second one is the default value to return if the parameter does not
Expand Down Expand Up @@ -241,14 +241,14 @@ Accessing `Accept-*` Headers Data
You can easily access basic data extracted from ``Accept-*`` headers
by using the following methods:

* :method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableContentTypes`:
returns the list of accepted content types ordered by descending quality;
:method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableContentTypes`
Returns the list of accepted content types ordered by descending quality.

* :method:`Symfony\\Component\\HttpFoundation\\Request::getLanguages`:
returns the list of accepted languages ordered by descending quality;
:method:`Symfony\\Component\\HttpFoundation\\Request::getLanguages`
Returns the list of accepted languages ordered by descending quality.

* :method:`Symfony\\Component\\HttpFoundation\\Request::getCharsets`:
returns the list of accepted charsets ordered by descending quality.
:method:`Symfony\\Component\\HttpFoundation\\Request::getCharsets`
Returns the list of accepted charsets ordered by descending quality.

.. versionadded:: 2.2
The :class:`Symfony\\Component\\HttpFoundation\\AcceptHeader` class was
Expand Down
21 changes: 13 additions & 8 deletions quick_tour/the_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ Understanding the Directory Structure
The directory structure of a Symfony :term:`application` is rather flexible,
but the recommended structure is as follows:

* ``app/``: the application configuration, templates and translations;
* ``src/``: the project's PHP code;
* ``vendor/``: the third-party dependencies;
* ``web/``: the web root directory.
``app/``
The application configuration, templates and translations.
``src/``
The project's PHP code.
``vendor/``
The third-party dependencies.
``web/``
The web root directory.

The ``web/`` Directory
~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -52,10 +56,11 @@ configuration and as such, it is stored in the ``app/`` directory.

This class must implement two methods:

* ``registerBundles()`` must return an array of all bundles needed to run the
application, as explained in the next section;
* ``registerContainerConfiguration()`` loads the application configuration
(more on this later).
``registerBundles()``
Must return an array of all bundles needed to run the application, as explained
in the next section.
``registerContainerConfiguration()``
Loads the application configuration (more on this later).

Autoloading is handled automatically via `Composer`_, which means that you
can use any PHP class without doing anything at all! All dependencies
Expand Down
14 changes: 8 additions & 6 deletions quick_tour/the_view.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ A Twig template is a text file that can generate any type of content (HTML, CSS,
JavaScript, XML, CSV, LaTeX, etc.) Twig elements are separated from the rest of
the template contents using any of these delimiters:

* ``{{ ... }}``: prints the content of a variable or the result of evaluating an
expression;
``{{ ... }}``
Prints the content of a variable or the result of evaluating an expression;

* ``{% ... %}``: controls the logic of the template; it is used for example to
execute ``for`` loops and ``if`` statements;
``{% ... %}``
Controls the logic of the template; it is used for example to execute ``for``
loops and ``if`` statements.

* ``{# ... #}``: allows including comments inside templates. Contrary to HTML
comments, they aren't included in the rendered template.
``{# ... #}``
Allows including comments inside templates. Contrary to HTML comments, they
aren't included in the rendered template.

Below is a minimal template that illustrates a few basics, using two variables
``page_title`` and ``navigation``, which would be passed into the template:
Expand Down

0 comments on commit dda1905

Please sign in to comment.