@@ -78,7 +78,7 @@ which defines the following two methods:
78
78
With a package, you can:
79
79
80
80
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 ``)
82
82
for the assets;
83
83
C) :ref: `configure a CDN <component-assets-cdn >` for the assets
84
84
@@ -161,7 +161,7 @@ Grouped Assets
161
161
Often, many assets live under a common path (e.g. ``/static/images ``). If
162
162
that's your case, replace the default :class: `Symfony\\ Component\\ Asset\\ Package `
163
163
class with :class: `Symfony\\ Component\\ Asset\\ PathPackage ` to avoid repeating
164
- that path time and again::
164
+ that path over and over again::
165
165
166
166
use Symfony\Component\Asset\PathPackage;
167
167
// ...
@@ -174,8 +174,8 @@ that path time and again::
174
174
Request Context Aware Assets
175
175
............................
176
176
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 ``
179
179
class can take into account the context of the current request::
180
180
181
181
use Symfony\Component\Asset\PathPackage;
@@ -191,11 +191,11 @@ class can take into account the context of the current request::
191
191
echo $package->getUrl('/logo.png');
192
192
// result: /somewhere/static/images/logo.png?v1
193
193
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 `` .
199
199
200
200
.. _component-assets-cdn :
201
201
@@ -230,7 +230,7 @@ You can also pass a schema-agnostic URL::
230
230
echo $package->getUrl('/logo.png');
231
231
// result: //static.example.com/images/logo.png?v1
232
232
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
234
234
a visitor is viewing your site in https. Just make sure that your CDN host
235
235
supports https.
236
236
@@ -274,8 +274,8 @@ protocol-relative URLs for HTTPs requests, any base URL for HTTP requests)::
274
274
new RequestStackContext($requestStack)
275
275
);
276
276
277
- // assuming the RequestStackContext says that we are on a secure host
278
277
echo $package->getUrl('/logo.png');
278
+ // assuming the RequestStackContext says that we are on a secure host
279
279
// result: https://example.com/logo.png?v1
280
280
281
281
Named Packages
0 commit comments