Skip to content

Commit 59325ee

Browse files
committed
Changes thanks to WouterJ and xabbuh
1 parent 110efab commit 59325ee

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

components/asset/introduction.rst

+11-11
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ which defines the following two methods:
7878
With a package, you can:
7979

8080
A) :ref:`version the assets <component-assets-versioning>`;
81-
B) set a :ref:`common base path (e.g. /css) <component-assets-path-package>`
81+
B) set a :ref:`common base path <component-assets-path-package>` (e.g. ``/css``)
8282
for the assets;
8383
C) :ref:`configure a CDN <component-assets-cdn>` for the assets
8484

@@ -161,7 +161,7 @@ Grouped Assets
161161
Often, many assets live under a common path (e.g. ``/static/images``). If
162162
that's your case, replace the default :class:`Symfony\\Component\\Asset\\Package`
163163
class with :class:`Symfony\\Component\\Asset\\PathPackage` to avoid repeating
164-
that path time and again::
164+
that path over and over again::
165165

166166
use Symfony\Component\Asset\PathPackage;
167167
// ...
@@ -174,8 +174,8 @@ that path time and again::
174174
Request Context Aware Assets
175175
............................
176176

177-
If you are also using the :doc:`HttpFoundation</components/http_foundation/introduction>`
178-
component in your project (for example in a Symfony application), the ``PathPackage``
177+
If you are also using the :doc:`HttpFoundation </components/http_foundation/introduction>`
178+
component in your project (for instance, in a Symfony application), the ``PathPackage``
179179
class can take into account the context of the current request::
180180

181181
use Symfony\Component\Asset\PathPackage;
@@ -191,11 +191,11 @@ class can take into account the context of the current request::
191191
echo $package->getUrl('/logo.png');
192192
// result: /somewhere/static/images/logo.png?v1
193193

194-
When the request context is set (via an optional third argument), in addition to
195-
the configured base path (i.e. ``/static/images``), ``PathPackage`` also
196-
prepends the current request base URL. So, for example, if your entire site
197-
is hosted under the ``/somewhere`` directory in your web server root directory,
198-
then ``/somewhere/`` will be prefixed to all paths.
194+
Now that the request context is set, the ``PathPackage`` will prepend the
195+
current request base URL. So, for example, if your entire site is hosted under
196+
the ``/somewhere`` directory of your web server root directory and the configured
197+
base path is ``/static/images``, all paths will be prefixed with
198+
``/somewhere/static/images``.
199199

200200
.. _component-assets-cdn:
201201

@@ -230,7 +230,7 @@ You can also pass a schema-agnostic URL::
230230
echo $package->getUrl('/logo.png');
231231
// result: //static.example.com/images/logo.png?v1
232232

233-
This is useful because assets will automatically be requested via https if
233+
This is useful because assets will automatically be requested via HTTPS if
234234
a visitor is viewing your site in https. Just make sure that your CDN host
235235
supports https.
236236

@@ -274,8 +274,8 @@ protocol-relative URLs for HTTPs requests, any base URL for HTTP requests)::
274274
new RequestStackContext($requestStack)
275275
);
276276

277-
// assuming the RequestStackContext says that we are on a secure host
278277
echo $package->getUrl('/logo.png');
278+
// assuming the RequestStackContext says that we are on a secure host
279279
// result: https://example.com/logo.png?v1
280280

281281
Named Packages

0 commit comments

Comments
 (0)