8000 Misc. minor fixes mostly related to formatting issues · symfony/symfony-docs@79bf0a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 79bf0a1

Browse files
committed
Misc. minor fixes mostly related to formatting issues
1 parent bffe163 commit 79bf0a1

File tree

7 files changed

+71
-67
lines changed

7 files changed

+71
-67
lines changed

book/doctrine.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,12 @@ doesn't replace your existing methods).
413413

414414
With the ``doctrine:generate:entities`` command you can:
415415

416-
* generate getters and setters;
416+
* generate getters and setters;
417417

418-
* generate repository classes configured with the
419-
``@ORM\Entity(repositoryClass="...")`` annotation;
418+
* generate repository classes configured with the
419+
``@ORM\Entity(repositoryClass="...")`` annotation;
420420

421-
* generate the appropriate constructor for 1:n and n:m relations.
421+
* generate the appropriate constructor for 1:n and n:m relations.
422422

423423
The ``doctrine:generate:entities`` command saves a backup of the original
424424
``Product.php`` named ``Product.php~``. In some cases, the presence of

book/http_cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ Cache Invalidation
10341034
------------------
10351035

10361036
"There are only two hard things in Computer Science: cache invalidation
1037-
and naming things." --Phil Karlton
1037+
and naming things." Phil Karlton
10381038

10391039
You should never need to invalidate cached data because invalidation is already
10401040
taken into account natively in the HTTP cache models. If you use validation,

book/routing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,9 @@ uses a simple string pattern called the *logical controller name*, which
850850
Symfony maps to a specific PHP method and class. The pattern has three parts,
851851
each separated by a colon:
852852

853-
**bundle**:**controller**:**action**
853+
.. code-block:: text
854+
855+
bundle:controller:action
854856
855857
For example, a ``_controller`` value of ``AcmeBlogBundle:Blog:show`` means:
856858

book/templating.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,17 @@ to web designers and, in several ways, more powerful than PHP templates:
7575
</body>
7676
</html>
7777

78-
Twig defines two types of special syntax:
78+
Twig defines three types of special syntax:
7979

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

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

86-
.. note::
87-
88-
There is a third syntax used for creating comments: ``{# this is a comment #}``.
89-
This syntax can be used across multiple lines like the PHP-equivalent
90-
``/* comment */`` syntax.
86+
* ``{# ... #}``: "Comment something": it's the equivalent of the PHP
87+
``/* comment */`` syntax. It's used to add single or multi-line comments.
88+
The content of the comments isn't included in the rendered pages.
9189

9290
Twig also contains **filters**, which modify content before being rendered.
9391
The following makes the ``title`` variable all uppercase before rendering
@@ -399,14 +397,14 @@ lives in a specific location:
399397
template for a specific page. The three parts of the string, each separated
400398
by a colon (``:``), mean the following:
401399

402-
* ``AcmeBlogBundle``: (*bundle*) the template lives inside the
403-
``AcmeBlogBundle`` (e.g. ``src/Acme/BlogBundle``);
400+
* ``AcmeBlogBundle``: (*bundle*) the template lives inside the
401+
``AcmeBlogBundle`` (e.g. ``src/Acme/BlogBundle``);
404402

405-
* ``Blog``: (*controller*) indicates that the template lives inside the
406-
``Blog`` subdirectory of ``Resources/views``;
403+
* ``Blog``: (*controller*) indicates that the template lives inside the
404+
``Blog`` subdirectory of ``Resources/views``;
407405

408-
* ``index.html.twig``: (*template*) the actual name of the file is
409-
``index.html.twig``.
406+
* ``index.html.twig``: (*template*) the actual name of the file is
407+
``index.html.twig``.
410408

411409
Assuming that the ``AcmeBlogBundle`` lives at ``src/Acme/BlogBundle``, the
412410
final path to the layout would be ``src/Acme/BlogBundle/Resources/views/Blog/index.html.twig``.

cookbook/configuration/environments.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,12 @@ The new environment is now accessible via::
287287

288288
.. note::
289289

290-
Some environments, like the ``dev`` environment, are never meant to be
291-
accessed on any deployed server by the general public. This is because
292-
certain environments, for debugging purposes, may give too much information
293-
about the application or underlying infrastructure. To be sure these environments
294-
aren't accessible, the front controller is usually protected from external
295-
IP addresses via the following code at the top of the controller:
290+
Some environments, like the ``dev`` environment, are never meant to be
291+
accessed on any deployed server by the general public. This is because
292+
certain environments, for debugging purposes, may give too much information
293+
about the application or underlying infrastructure. To be sure these environments
294+
aren't accessible, the front controller is usually protected from external
295+
IP addresses via the following code at the top of the controller:
296296

297297
.. code-block:: php
298298
@@ -315,8 +315,12 @@ However, each environment caches its own set of files:
315315

316316
.. code-block:: text
317317
318-
app/cache/dev - cache directory for the *dev* environment
319-
app/cache/prod - cache directory for the *prod* environment
318+
<your-project>/
319+
├─ app/
320+
│ ├─ cache/
321+
│ │ ├─ dev/ // cache directory for the *dev* environment
322+
│ │ └─ prod/ // cache directory for the *prod* environment
323+
│ ├─ ...
320324
321325
Sometimes, when debugging, it may be helpful to inspect a cached file to
322326
understand how something is working. When doing so, remember to look in

cookbook/configuration/web_server_configuration.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ following configuration snippet:
5555
In Apache 2.4, ``Order allow,deny`` has been replaced by ``Require all granted``,
5656
and hence you need to modify your ``Directory`` permission settings as follows:
5757

58-
.. code-block:: apache
58+
.. code-block:: apache
5959
60-
<Directory /var/www/project/web>
61-
# enable the .htaccess rewrites
62-
AllowOverride All
63-
Require all granted
64-
</Directory>
60+
<Directory /var/www/project/web>
61+
# enable the .htaccess rewrites
62+
AllowOverride All
63+
Require all granted
64+
</Directory>
6565
6666
Nginx
6767
-----

cookbook/form/data_transformers.rst

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -109,49 +109,49 @@ Using the Transformer
109109
Now that you have the transformer built, you just need to add it to your
110110
issue field in some form.
111111

112-
You can also use transformers without creating a new custom form type
113-
by calling ``addModelTransformer`` (or ``addViewTransformer`` - see
114-
`Model and View Transformers`_) on any field builder::
112+
You can also use transformers without creating a new custom form type
113+
by calling ``addModelTransformer`` (or ``addViewTransformer`` - see
114+
`Model and View Transformers`_) on any field builder::
115115

116-
use Symfony\Component\Form\FormBuilderInterface;
117-
use Acme\TaskBundle\Form\DataTransformer\IssueToNumberTransformer;
116+
use Symfony\Component\Form\FormBuilderInterface;
117+
use Acme\TaskBundle\Form\DataTransformer\IssueToNumberTransformer;
118118

119-
class TaskType extends AbstractType
119+
class TaskType extends AbstractType
120+
{
121+
public function buildForm(FormBuilderInterface $builder, array $options)
120122
{
121-
public function buildForm(FormBuilderInterface $builder, array $options)
122-
{
123-
// ...
124-
125-
// this assumes that the entity manager was passed in as an option
126-
$entityManager = $options['em'];
127-
$transformer = new IssueToNumberTransformer($entityManager);
128-
129-
// add a normal text field, but add your transformer to it
130-
$builder->add(
131-
$builder->create('issue', 'text')
132-
->addModelTransformer($transformer)
133-
);
134-
}
123+
// ...
135124

136-
public function setDefaultOptions(OptionsResolverInterface $resolver)
137-
{
138-
$resolver
139-
->setDefaults(array(
140-
'data_class' => 'Acme\TaskBundle\Entity\Task',
141-
))
142-
->setRequired(array(
143-
'em',
144-
))
145-
->setAllowedTypes(array(
146-
'em' => 'Doctrine\Common\Persistence\ObjectManager',
147-
));
148-
149-
// ...
150-
}
125+
// this assumes that the entity manager was passed in as an option
126+
$entityManager = $options['em'];
127+
$transformer = new IssueToNumberTransformer($entityManager);
128+
129+
// add a normal text field, but add your transformer to it
130+
$builder->add(
131+
$builder->create('issue', 'text')
132+
->addModelTransformer($transformer)
133+
);
134+
}
135+
136+
public function setDefaultOptions(OptionsResolverInterface $resolver)
137+
{
138+
$resolver
139+
->setDefaults(array(
140+
'data_class' => 'Acme\TaskBundle\Entity\Task',
141+
))
142+
->setRequired(array(
143+
'em',
144+
))
145+
->setAllowedTypes(array(
146+
'em' => 'Doctrine\Common\Persistence\ObjectManager',
147+
));
151148

152149
// ...
153150
}
154151

152+
// ...
153+
}
154+
155155
This example requires that you pass in the entity manager as an option
156156
when creating your form. Later, you'll learn how you could create a custom
157157
``issue`` field type to avoid needing to do this in your controller::

0 commit comments

Comments
 (0)
0