@@ -534,7 +534,7 @@ information you need about the request.
534
534
Like the ``Request ``, the ``Response `` object has a public ``headers `` property.
535
535
This object is of the type :class: `Symfony\\ Component\\ HttpFoundation\\ ResponseHeaderBag `
536
536
and provides methods for getting and setting response headers. The header names are
537
- normalized. As a result, the name ``Content-Type `` is equivalent to
537
+ normalized. As a result, the name ``Content-Type `` is equivalent to
538
538
the name ``content-type `` or ``content_type ``.
539
539
540
540
In Symfony, a controller is required to return a ``Response `` object::
@@ -548,9 +548,10 @@ In Symfony, a controller is required to return a ``Response`` object::
548
548
$response = new Response('<style> ... </style>');
549
549
$response->headers->set('Content-Type', 'text/css');
550
550
551
- To facilitate this, different response objects are included to address different response types.
552
- Some of these are mentioned below. To learn more about the ``Request `` and ``Response `` (and different
553
- ``Response `` classes), see the :ref: `HttpFoundation component documentation <component-http-foundation-request >`.
551
+ To facilitate this, different response objects are included to address different
552
+ response types. Some of these are mentioned below. To learn more about the
553
+ ``Request `` and ``Response `` (and different ``Response `` classes), see the
554
+ :ref: `HttpFoundation component documentation <component-http-foundation-request >`.
554
555
555
556
Returning JSON Response
556
557
~~~~~~~~~~~~~~~~~~~~~~~
@@ -606,15 +607,16 @@ The ``file()`` helper provides some arguments to configure its behavior::
606
607
Final Thoughts
607
608
--------------
608
609
609
- In Symfony, a controller is usually a class method which is used to accept requests,
610
- and return a ``Response `` object. When mapped with a url , a controller becomes accessible
611
- and its response can be viewed.
610
+ In Symfony, a controller is usually a class method which is used to accept
611
+ requests, and return a ``Response `` object. When mapped with a URL , a controller
612
+ becomes accessible and its response can be viewed.
612
613
613
- To facilitate the development of controllers, Symfony provides an ``AbstractController ``. It
614
- can be used to extend the controller class allowing access to some frequently used utilities
615
- such as ``render `` and ``redirectToRoute ``. The ``AbstractController `` also
616
- provides the ``createNotFoundException `` utility which is used to return a page
617
- not found response.
614
+ To facilitate the development of controllers, Symfony provides an
615
+ ``AbstractController ``. It can be used to extend the controller class allowing
616
+ access to some frequently used utilities such as ``render() `` and
617
+ ``redirectToRoute() ``. The ``AbstractController `` also provides the
618
+ ``createNotFoundException() `` utility which is used to return a page not found
619
+ response.
618
620
619
621
In other articles, you'll learn how to use specific services from inside your controller
620
622
that will help you persist and fetch objects from a database, process form submissions,
0 commit comments