8000 Changed to definition lists from Book section · symfony/symfony-docs@3d865bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d865bb

Browse files
Changed to definition lists from Book section
1 parent 22ecade commit 3d865bb

File tree

6 files changed

+133
-109
lines changed

6 files changed

+133
-109
lines changed

book/forms.rst

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -714,14 +714,16 @@ the correct values of a number of field options.
714714
And though you'll need to manually add your server-side validation, these
715715
field type options can then be guessed from that information.
716716

717-
* ``required``: The ``required`` option can be guessed based on the validation
718-
rules (i.e. is the field ``NotBlank`` or ``NotNull``) or the Doctrine metadata
719-
(i.e. is the field ``nullable``). This is very useful, as your client-side
720-
validation will automatically match your validation rules.
717+
``required``
718+
The ``required`` option can be guessed based on the validation rules (i.e. is
719+
the field ``NotBlank`` or ``NotNull``) or the Doctrine metadata (i.e. is the
720+
field ``nullable``). This is very useful, as your client-side validation will
721+
automatically match your validation rules.
721722

722-
* ``max_length``: If the field is some sort of text field, then the ``max_length``
723-
option can be guessed from the validation constraints (if ``Length`` or
724-
``Range`` is used) or from the Doctrine metadata (via the field's length).
723+
``max_length``
724+
If the field is some sort of text field, then the ``max_length`` option can be
725+
guessed from the validation constraints (if ``Length`` or ``Range`` is used) or
726+
from the Doctrine metadata (via the field's length).
725727

726728
.. note::
727729

@@ -768,18 +770,21 @@ of code. Of course, you'll usually need much more flexibility when rendering:
768770

769771
Take a look at each part:
770772

771-
* ``form_start(form)`` - Renders the start tag of the form.
773+
``form_start(form)``
774+
Renders the start tag of the form.
772775

773-
* ``form_errors(form)`` - Renders any errors global to the whole form
774-
(field-specific errors are displayed next to each field);
776+
``form_errors(form)``
777+
Renders any errors global to the whole form (field-specific errors are displayed
778+
next to each field).
775779

776-
* ``form_row(form.dueDate)`` - Renders the label, any errors, and the HTML
777-
form widget for the given field (e.g. ``dueDate``) inside, by default, a
778-
``div`` element;
780+
``form_row(form.dueDate)``
781+
Renders the label, any errors, and the HTML form widget for the given field
782+
(e.g. ``dueDate``) inside, by default, a ``div`` element.
779783

780-
* ``form_end()`` - Renders the end tag of the form and any fields that have not
781-
yet been rendered. This is useful for rendering hidden fields and taking
782-
advantage of the automatic :ref:`CSRF Protection <forms-csrf>`.
784+
``form_end()``
785+
Renders the end tag of the form and any fields that have not yet been rendered.
786+
This is useful for rendering hidden fields and taking advantage of the
787+
automatic :ref:`CSRF Protection <forms-csrf>`.
783788

784789
The majority of the work is done by the ``form_row`` helper, which renders
785790
the label, errors and HTML form widget of each field inside a ``div`` tag

book/http_cache.rst

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -202,34 +202,39 @@ method::
202202

203203
Here is a list of the main options:
204204

205-
* ``default_ttl``: The number of seconds that a cache entry should be
206-
considered fresh when no explicit freshness information is provided in a
207-
response. Explicit ``Cache-Control`` or ``Expires`` headers override this
208-
value (default: ``0``);
209-
210-
* ``private_headers``: Set of request headers that trigger "private"
211-
``Cache-Control`` behavior on responses that don't explicitly state whether
212-
the response is ``public`` or ``private`` via a ``Cache-Control`` directive.
213-
(default: ``Authorization`` and ``Cookie``);
214-
215-
* ``allow_reload``: Specifies whether the client can force a cache reload by
216-
including a ``Cache-Control`` "no-cache" directive in the request. Set it to
217-
``true`` for compliance with RFC 2616 (default: ``false``);
218-
219-
* ``allow_revalidate``: Specifies whether the client can force a cache
220-
revalidate by including a ``Cache-Control`` "max-age=0" directive in the
221-
request. Set it to ``true`` for compliance with RFC 2616 (default: false);
222-
223-
* ``stale_while_revalidate``: Specifies the default number of seconds (the
224-
granularity is the second as the Response TTL precision is a second) during
225-
which the cache can immediately return a stale response while it revalidates
226-
it in the background (default: ``2``); this setting is overridden by the
227-
``stale-while-revalidate`` HTTP ``Cache-Control`` extension (see RFC 5861);
228-
229-
* ``stale_if_error``: Specifies the default number of seconds (the granularity
230-
is the second) during which the cache can serve a stale response when an
231-
error is encountered (default: ``60``). This setting is overridden by the
232-
``stale-if-error`` HTTP ``Cache-Control`` extension (see RFC 5861).
205+
``default_ttl``
206+
The number of seconds that a cache entry should be considered fresh when no
207+
explicit freshness information is provided in a response. Explicit
208+
``Cache-Control`` or ``Expires`` headers override this value (default: ``0``).
209+
210+
``private_headers``
211+
Set of request headers that trigger "private" ``Cache-Control`` behavior on
212+
responses that don't explicitly state whether the response is ``public`` or
213+
``private`` via a ``Cache-Control`` directive (default: ``Authorization``
214+
and ``Cookie``).
215+
216+
``allow_reload``
217+
Specifies whether the client can force a cache reload by including a
218+
``Cache-Control`` "no-cache" directive in the request. Set it to ``true`` for
219+
compliance with RFC 2616 (default: ``false``).
220+
221+
``allow_revalidate``
222+
Specifies whether the client can force a cache revalidate by including a
223+
``Cache-Control`` "max-age=0" directive in the request. Set it to ``true`` for
224+
compliance with RFC 2616 (default: false).
225+
226+
``stale_while_revalidate``
227+
Specifies the default number of seconds (the granularity is the second as the
228+
Response TTL precision is a second) during which the cache can immediately
229+
return a stale response while it revalidates it in the background (default:
230+
``2``); this setting is overridden by the ``stale-while-revalidate`` HTTP
231+
``Cache-Control`` extension (see RFC 5861).
232+
233+
``stale_if_error``
234+
Specifies the default number of seconds (the granularity is the second) during
235+
which the cache can serve a stale response when an error is encountered
236+
(default: ``60``). This setting is overridden by the ``stale-if-error`` HTTP
237+
``Cache-Control`` extension (see RFC 5861).
233238

234239
If ``debug`` is ``true``, Symfony automatically adds a ``X-Symfony-Cache``
235240
header to the response containing useful information about cache hits and
@@ -339,11 +344,12 @@ and then returned to every subsequent user who asked for their account page!
339344

340345
To handle this situation, every response may be set to be public or private:
341346

342-
* *public*: Indicates that the response may be cached by both private and
343-
shared caches;
347+
*public*
348+
Indicates that the response may be cached by both private and shared caches.
344349

345-
* *private*: Indicates that all or part of the response message is intended
346-
for a single user and must not be cached by a shared cache.
350+
*private*
351+
Indicates that all or part of the response message is intended for a single
352+
user and must not be cached by a shared cache.
347353

348354
Symfony conservatively defaults each response to be private. To take advantage
349355
of shared caches (like the Symfony reverse proxy), the response will need
@@ -1033,12 +1039,14 @@ possible.
10331039

10341040
The ``render_esi`` helper supports two other useful options:
10351041

1036-
* ``alt``: used as the ``alt`` attribute on the ESI tag, which allows you
1037-
to specify an alternative URL to be used if the ``src`` cannot be found;
1042+
``alt``
1043+
Used as the ``alt`` attribute on the ESI tag, which allows you to specify an
1044+
alternative URL to be used if the ``src`` cannot be found.
10381045

1039-
* ``ignore_errors``: if set to true, an ``onerror`` attribute will be added
1040-
to the ESI with a value of ``continue`` indicating that, in the event of
1041-
a failure, the gateway cache will simply remove the ESI tag silently.
1046+
``ignore_errors``
1047+
If set to true, an ``onerror`` attribute will be added to the ESI with a value
1048+
of ``continue`` indicating that, in the event of a failure, the gateway cache
1049+
will simply remove the ESI tag silently.
10421050

10431051
.. index::
10441052
single: Cache; Invalidation

book/http_fundamentals.rst

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -519,33 +519,36 @@ libraries that can be used inside *any* PHP project. These libraries, called
519519
the *Symfony Components*, contain something useful for almost any situation,
520520
regardless of how your project is developed. To name a few:
521521

522-
* :doc:`HttpFoundation </components/http_foundation/introduction>` - Contains
523-
the ``Request`` and ``Response`` classes, as well as other classes for handling
524-
sessions and file uploads;
522+
:doc:`HttpFoundation </components/http_foundation/introduction>`
523+
Contains the ``Request`` and ``Response`` classes, as well as other classes for
524+
handling sessions and file uploads.
525525

526-
* :doc:`Routing </components/routing/introduction>` - Powerful and fast routing system that
527-
allows you to map a specific URI (e.g. ``/contact``) to some information
528-
about how that request should be handled (e.g. execute the ``contactAction()``
529-
method);
526+
:doc:`Routing </components/routing/introduction>`
527+
Powerful and fast routing system that allows you to map a specific URI
528+
(e.g. ``/contact``) to some information about how that request should be handled
529+
(e.g. execute the ``contactAction()`` method).
530530

531-
* `Form`_ - A full-featured and flexible framework for creating forms and
532-
handling form submissions;
531+
`Form`_
532+
A full-featured and flexible framework for creating forms and handling form
533+
submissions.
533534

534-
* `Validator`_ - A system for creating rules about data and then validating
535-
whether or not user-submitted data follows those rules;
535+
`Validator`_
536+
A system for creating rules about data and then validating whether or not
537+
user-submitted data follows those rules.
536538

537-
* :doc:`ClassLoader </components/class_loader/introduction>` - An autoloading library that allows
538-
PHP classes to be used without needing to manually ``require`` the files
539-
containing those classes;
539+
:doc:`ClassLoader </components/class_loader/introduction>`
540+
An autoloading library that allows PHP classes to be used without needing to
541+
manually ``require`` the files containing those classes.
540542

541-
* :doc:`Templating </components/templating/introduction>` - A toolkit for rendering
542-
templates, handling template inheritance (i.e. a template is decorated with
543-
a layout) and performing other common template tasks;
543+
:doc:`Templating </components/templating/introduction>`
544+
A toolkit for rendering templates, handling template inheritance (i.e. a
545+
template is decorated with a layout) and performing other common template tasks.
544546

545-
* `Security`_ - A powerful library for handling all types of security inside
546-
an application;
547+
`Security`_
548+
A powerful library for handling all types of security inside an application.
547549

548-
* `Translation`_ - A framework for translating strings in your application.
550+
`Translation`_
551+
A framework for translating strings in your application.
549552

550553
Each and every one of these components is decoupled and can be used in *any*
551554
PHP project, regardless of whether or not you use the Symfony framework.

book/internals.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ Each event thrown by the Kernel is a subclass of
212212
:class:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent`. This means that
213213
each event has access to the same basic information:
214214

215-
* :method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::getRequestType`
216-
- returns the *type* of the request (``HttpKernelInterface::MASTER_REQUEST``
217-
or ``HttpKernelInterface::SUB_REQUEST``);
215+
:method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::getRequestType`
216+
Returns the *type* of the request (``HttpKernelInterface::MASTER_REQUEST`` or
217+
``HttpKernelInterface::SUB_REQUEST``).
218218

219-
* :method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::getKernel`
220-
- returns the Kernel handling the request;
219+
:method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::getKernel`
220+
Returns the Kernel handling the request.
221221

222-
* :method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::getRequest`
223-
- returns the current ``Request`` being handled.
222+
:method:`Symfony\\Component\\HttpKernel\\Event\\KernelEvent::getRequest`
223+
Returns the current ``Request`` being handled.
224224

225225
``getRequestType()``
226226
....................
@@ -347,18 +347,18 @@ The purpose of this event is to allow other systems to modify or replace the
347347

348348
The FrameworkBundle registers several listeners:
349349

350-
* :class:`Symfony\\Component\\HttpKernel\\EventListener\\ProfilerListener`:
351-
collects data for the current request;
350+
:class:`Symfony\\Component\\HttpKernel\\EventListener\\ProfilerListener`
351+
Collects data for the current request.
352352

353-
* :class:`Symfony\\Bundle\\WebProfilerBundle\\EventListener\\WebDebugToolbarListener`:
354-
injects the Web Debug Toolbar;
353+
:class:`Symfony\\Bundle\\WebProfilerBundle\\EventListener\\WebDebugToolbarListener`
354+
Injects the Web Debug Toolbar.
355355

356-
* :class:`Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener`: fixes the
357-
Response ``Content-Type`` based on the request format;
356+
:class:`Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener`
357+
Fixes the Response ``Content-Type`` based on the request format.
358358

359-
* :class:`Symfony\\Component\\HttpKernel\\EventListener\\EsiListener`: adds a
360-
``Surrogate-Control`` HTTP header when the Response needs to be parsed for
361-
ESI tags.
359+
:class:`Symfony\\Component\\HttpKernel\\EventListener\\EsiListener`
360+
Adds a ``Surrogate-Control`` HTTP header when the Response needs to be parsed
361+
for ESI tags.
362362

363363
.. seealso::
364364

book/templating.rst

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -384,15 +384,16 @@ Template Naming and Locations
384384

385385
By default, templates can live in two different locations:
386386

387-
* ``app/Resources/views/``: The applications ``views`` directory can contain
388-
application-wide base templates (i.e. your application's layouts and
389-
templates of the application bundle) as well as templates that override
390-
third party bundle templates (see :ref:`overriding-bundle-templates`);
387+
``app/Resources/views/``
388+
The applications ``views`` directory can contain application-wide base templates
389+
(i.e. your application's layouts and templates of the application bundle) as
390+
well as templates that override third party bundle templates
391+
(see :ref:`overriding-bundle-templates`).
391392

392-
* ``path/to/bundle/Resources/views/``: Each third party bundle houses its
393-
templates in its ``Resources/views/`` directory (and subdirectories). When you
394-
plan to share your bundle, you should put the templates in the bundle instead
395-
of the ``app/`` directory.
393+
``path/to/bundle/Resources/views/``
394+
Each third party bundle houses its templates in its ``Resources/views/``
395+
directory (and subdirectories). When you plan to share your bundle, you should
396+
put the templates in the bundle instead of the ``app/`` directory.
396397

397398
Most of the templates you'll use live in the ``app/Resources/views/``
398399
directory. The path you'll use will be relative to this directory. For example,
@@ -1123,12 +1124,18 @@ is a :class:`Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables`
11231124
instance which will give you access to some application specific variables
11241125
automatically:
11251126

1126-
* ``app.security`` - The security context.
1127-
* ``app.user`` - The current user object.
1128-
* ``app.request`` - The request object.
1129-
* ``app.session`` - The session object.
1130-
* ``app.environment`` - The current environment (dev, prod, etc).
1131-
* ``app.debug`` - True if in debug mode. False otherwise.
1127+
``app.security``
1128+
The security context.
1129+
``app.user``
1130+
The current user object.
1131+
``app.request``
1132+
The request object.
1133+
``app.session``
1134+
The session object.
1135+
``app.environment``
1136+
The current environment (dev, prod, etc).
1137+
``app.debug``
1138+
True if in debug mode. False otherwise.
11321139

11331140
.. configuration-block::
11341141

book/validation.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -809,14 +809,15 @@ user registers and when a user updates their contact information later:
809809
810810
With this configuration, there are three validation groups:
811811

812-
* ``Default`` - contains the constraints in the current class and all
813-
referenced classes that belong to no other group;
812+
``Default``
813+
Contains the constraints in the current class and all referenced classes
814+
that belong to no other group.
814815

815-
* ``User`` - equivalent to all constraints of the ``User`` object in the
816-
``Default`` group;
816+
``User``
817+
Equivalent to all constraints of the ``User`` object in the ``Default`` group.
817818

818-
* ``registration`` - contains the constraints on the ``email`` and ``password``
819-
fields only.
819+
``registration``
820+
Contains the constraints on the ``email`` and ``password`` fields only.
820821

821822
To tell the validator to use a specific group, pass one or more group names
822823
as the second argument to the ``validate()`` method::

0 commit comments

Comments
 (0)
0