Skip to content

Commit 7c0a3a1

Browse files
committed
review getting started chapter for belittling words
1 parent c8a29df commit 7c0a3a1

File tree

4 files changed

+37
-34
lines changed

4 files changed

+37
-34
lines changed

controller.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Symfony comes *packed* with a lot of useful objects, called :doc:`services </ser
192192
These are used for rendering templates, sending emails, querying the database and
193193
any other "work" you can think of.
194194

195-
If you need a service in a controller, just type-hint an argument with its class
195+
If you need a service in a controller, type-hint an argument with its class
196196
(or interface) name. Symfony will automatically pass you the service you need::
197197

198198
use Psr\Log\LoggerInterface
@@ -273,7 +273,7 @@ the argument by its name:
273273
))
274274
;
275275
276-
You can of course also use normal :ref:`constructor injection <services-constructor-injection>`
276+
Like with all services, you can also use regular :ref:`constructor injection <services-constructor-injection>`
277277
in your controllers.
278278

279279
.. versionadded:: 4.1
@@ -358,7 +358,7 @@ The Request object as a Controller Argument
358358

359359
What if you need to read query parameters, grab a request header or get access
360360
to an uploaded file? All of that information is stored in Symfony's ``Request``
361-
object. To get it in your controller, just add it as an argument and
361+
object. To get it in your controller, add it as an argument and
362362
**type-hint it with the Request class**::
363363

364364
use Symfony\Component\HttpFoundation\Request;

routing.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ use them later to :ref:`generate URLs <routing-generate>`.
137137
.. sidebar:: Routing in Other Formats
138138

139139
The ``@Route`` above each method is called an *annotation*. If you'd rather
140-
configure your routes in YAML, XML or PHP, that's no problem! Just create a
141-
new routing file (e.g. ``routes.xml``) and Symfony will automatically use it.
140+
configure your routes in YAML, XML or PHP, that's no problem! Create a new
141+
routing file (e.g. ``routes.xml``) in the ``config/`` directory and Symfony
142+
will automatically use it.
142143

143144
.. _i18n-routing:
144145

@@ -759,7 +760,7 @@ Route path If the requested URL is ``/foo`` If the requested URL is ``
759760
Controller Naming Pattern
760761
-------------------------
761762

762-
The ``controller`` value in your routes has a very simple format ``CONTROLLER_CLASS::METHOD``.
763+
The ``controller`` value in your routes has the format ``CONTROLLER_CLASS::METHOD``.
763764

764765
.. tip::
765766

@@ -780,7 +781,7 @@ system: mapping the URL to a controller and also a route back to a URL.
780781

781782
To generate a URL, you need to specify the name of the route (e.g. ``blog_show``)
782783
and any wildcards (e.g. ``slug = my-blog-post``) used in the path for that
783-
route. With this information, any URL can easily be generated::
784+
route. With this information, an URL can be generated in a controller::
784785

785786
class MainController extends AbstractController
786787
{

setup.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Running your Symfony Application
4343

4444
On production, you should use a web server like Nginx or Apache
4545
(see :doc:`configuring a web server to run Symfony </setup/web_server_configuration>`).
46-
But for development, it's even easier to use the :doc:`Symfony PHP web server <setup/built_in_web_server>`.
46+
But for development, it's convenient to use the :doc:`Symfony PHP web server <setup/built_in_web_server>`.
4747

4848
Move into your new project and start the server:
4949

@@ -76,8 +76,9 @@ by pressing ``Ctrl+C`` from your terminal.
7676
Storing your Project in git
7777
---------------------------
7878

79-
Storing your project in services like GitHub, GitLab and Bitbucket is easy! Init
80-
a new repository with ``Git`` and you are ready to push to your remote:
79+
Storing your project in services like GitHub, GitLab and Bitbucket works like with
80+
any other code project! Init a new repository with ``Git`` and you are ready to push
81+
to your remote:
8182

8283
.. code-block:: terminal
8384
@@ -94,9 +95,9 @@ that file when needed.
9495
Setting up an Existing Symfony Project
9596
--------------------------------------
9697

97-
If you're working on an existing Symfony application, you'll just need to do a few
98-
things to get your project setup. Assuming your team uses Git, you can setup your
99-
project with the following commands:
98+
If you're working on an existing Symfony application, you only need to get the
99+
project code and install the dependencies with composer. Assuming your team uses Git,
100+
setup your project with the following commands:
100101

101102
.. code-block:: terminal
102103

templating.rst

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ Twig Template Caching
148148
Twig is fast because each template is compiled to a native PHP class and cached.
149149
But don't worry: this happens automatically and doesn't require *you* to do anything.
150150
And while you're developing, Twig is smart enough to re-compile your templates after
151-
you make any changes. That means Twig is fast in production, but easy to use while
152-
developing.
151+
you make any changes. That means Twig is fast in production, but convenient to use
152+
while developing.
153153

154154
.. index::
155155
single: Templating; Inheritance
@@ -200,12 +200,12 @@ First, build a base layout file:
200200
Though the discussion about template inheritance will be in terms of Twig,
201201
the philosophy is the same between Twig and PHP templates.
202202

203-
This template defines the base HTML skeleton document of a simple two-column
203+
This template defines the base HTML skeleton document of a two-column
204204
page. In this example, three ``{% block %}`` areas are defined (``title``,
205205
``sidebar`` and ``body``). Each block may be overridden by a child template
206206
or left with its default implementation. This template could also be rendered
207207
directly. In that case the ``title``, ``sidebar`` and ``body`` blocks would
208-
simply retain the default values used in this template.
208+
retain the default values used in this template.
209209

210210
A child template might look like this:
211211

@@ -226,7 +226,7 @@ A child template might look like this:
226226
.. note::
227227

228228
The parent template is stored in ``templates/``, so its path is
229-
simply ``base.html.twig``. The template naming conventions are explained
229+
``base.html.twig``. The template naming conventions are explained
230230
fully in :ref:`template-naming-locations`.
231231

232232
The key to template inheritance is the ``{% extends %}`` tag. This tells
@@ -437,7 +437,8 @@ template. First, create the template that you'll need to reuse.
437437
{{ article.body }}
438438
</p>
439439

440-
Including this template from any other template is simple:
440+
Including this template from any other template is achieved with the
441+
``{{ include() }}`` function:
441442

442443
.. code-block:: html+twig
443444

@@ -452,12 +453,11 @@ Including this template from any other template is simple:
452453
{% endfor %}
453454
{% endblock %}
454455

455-
The template is included using the ``{{ include() }}`` function. Notice that the
456-
template name follows the same typical convention. The ``article_details.html.twig``
457-
template uses an ``article`` variable, which we pass to it. In this case,
458-
you could avoid doing this entirely, as all of the variables available in
459-
``list.html.twig`` are also available in ``article_details.html.twig`` (unless
460-
you set `with_context`_ to false).
456+
Notice that the template name follows the same typical convention. The
457+
``article_details.html.twig`` template uses an ``article`` variable, which we
458+
pass to it. In this case, you could avoid doing this entirely, as all of the
459+
variables available in ``list.html.twig`` are also available in
460+
``article_details.html.twig`` (unless you set `with_context`_ to false).
461461

462462
.. tip::
463463

@@ -537,7 +537,7 @@ configuration:
537537
538538
return $routes;
539539
540-
To link to the page, just use the ``path()`` Twig function and refer to the route:
540+
To link to the page, use the ``path()`` Twig function and refer to the route:
541541

542542
.. code-block:: html+twig
543543

@@ -631,7 +631,7 @@ Linking to Assets
631631
~~~~~~~~~~~~~~~~~
632632

633633
Templates also commonly refer to images, JavaScript, stylesheets and other
634-
assets. Of course you could hard-code the path to these assets (e.g. ``/images/logo.png``),
634+
assets. You could hard-code the web path to these assets (e.g. ``/images/logo.png``),
635635
but Symfony provides a more dynamic option via the ``asset()`` Twig function.
636636

637637
To use this function, install the *asset* package:
@@ -715,8 +715,9 @@ stylesheets and JavaScripts that you'll need throughout your site:
715715
</body>
716716
</html>
717717

718-
That's easy enough! But what if you need to include an extra stylesheet or
719-
JavaScript from a child template? For example, suppose you have a contact
718+
This looks almost like regular HTML, but with the addition of the
719+
``{% block %}``. Those are useful when you need to include an extra stylesheet
720+
or JavaScript from a child template. For example, suppose you have a contact
720721
page and you need to include a ``contact.css`` stylesheet *just* on that
721722
page. From inside that contact page's template, do the following:
722723

@@ -733,11 +734,11 @@ page. From inside that contact page's template, do the following:
733734

734735
{# ... #}
735736

736-
In the child template, you simply override the ``stylesheets`` block and
737-
put your new stylesheet tag inside of that block. Of course, since you want
738-
to add to the parent block's content (and not actually *replace* it), you
739-
should use the ``parent()`` Twig function to include everything from the ``stylesheets``
740-
block of the base template.
737+
In the child template, you override the ``stylesheets`` block and put your new
738+
stylesheet tag inside of that block. Since you want to add to the parent
739+
block's content (and not actually *replace* it), you also use the ``parent()``
740+
Twig function to include everything from the ``stylesheets`` block of the base
741+
template.
741742

742743
You can also include assets located in your bundles' ``Resources/public/`` folder.
743744
You will need to run the ``php bin/console assets:install target [--symlink]``

0 commit comments

Comments
 (0)