@@ -83,12 +83,12 @@ assets are cached.
8383
8484Instead of relying on a simple version mechanism, the Asset component allows to
8585define advanced versioning strategies via PHP classes. The two built-in strategies
86- provided by the component are :class: `Symfony\C omponent\A sset\V ersionStrategy\E mptyVersionStrategy `,
87- which doesn't add any version to the asset and :class: `Symfony\C omponent\A sset\V ersionStrategy\S taticVersionStrategy `,
86+ provided by the component are :class: `Symfony\\ Component\\ Asset\\ VersionStrategy\ \ EmptyVersionStrategy `,
87+ which doesn't add any version to the asset and :class: `Symfony\\ Component\\ Asset\\ VersionStrategy\ \ StaticVersionStrategy `,
8888which allows to set the version with a format string.
8989
90- In this example, the :class: ` Symfony \C omponent \A sset \V ersionStrategy \ S taticVersionStrategy `
91- is used to append the `` v1 `` suffix to any asset path::
90+ In this example, the `` StaticVersionStrategy `` is used to append the `` v1 ` `
91+ suffix to any asset path::
9292
9393 use Symfony\Component\Asset\Package;
9494 use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
@@ -99,8 +99,7 @@ is used to append the ``v1`` suffix to any asset path::
9999 // result: /image.png?v1
100100
101101In case you want to modify the version format, pass a sprintf-compatible format
102- string as the second argument of the
103- :class: `Symfony\C omponent\A sset\V ersionStrategy\S taticVersionStrategy ` constructor::
102+ string as the second argument of the ``StaticVersionStrategy `` constructor::
104103
105104 // put the 'version' word before the version value
106105 $package = new Package(new StaticVersionStrategy('v1', '%s?version=%s'));
@@ -117,7 +116,7 @@ string as the second argument of the
117116Custom Version Strategies
118117.........................
119118
120- Use the :class: `Symfony\C omponent\A sset\V ersionStrategy\V ersionStrategyInterface `
119+ Use the :class: `Symfony\\ Component\\ Asset\\ VersionStrategy\ \ VersionStrategyInterface `
121120to define your own version strategy. For example, you could define a versioning
122121where the current date is appended to bust the cache every day::
123122
@@ -147,9 +146,9 @@ Grouped Assets
147146~~~~~~~~~~~~~~
148147
149148It's common for applications to store their assets in a common path. If that's
150- your case, replace the default :class: `Symfony\C omponent\A sset\P ackage ` class by
151- :class: `Symfony\C omponent\A sset\P athPackage ` to avoid repeating the same path
152- time and again::
149+ your case, replace the default :class: `Symfony\\ Component\\ Asset\\ Package ` class
150+ by :class: `Symfony\\ Component\\ Asset\\ PathPackage ` to avoid repeating the same
151+ path time and again::
153152
154153 use Symfony\Component\Asset\PathPackage;
155154 // ...
@@ -163,8 +162,8 @@ Request Context Aware Assets
163162............................
164163
165164If you are also using the HttpFoundation component in your project, for example
166- in a Symfony application, the :class: ` Symfony \C omponent \A sset \ P athPackage ` class
167- can take into account the context of the current request::
165+ in a Symfony application, the `` PathPackage `` class can take into account the
166+ context of the current request::
168167
169168 use Symfony\Component\Asset\PathPackage;
170169 use Symfony\Component\Asset\Context\RequestStackContext;
@@ -180,15 +179,15 @@ can take into account the context of the current request::
180179 // result: /somewhere/static/images/logo.png?v1
181180
182181When the request context is set (via the third optional argument), in addition
183- to the configured base path, :class: ` Symfony \C omponent \A sset \ P athPackage ` also
184- prepends the current request base URL (``/somewhere/ `` in this example) to assets.
185- This allows your website to be hosted anywhere under the web server root directory.
182+ to the configured base path, `` PathPackage `` also prepends the current request
183+ base URL (``/somewhere/ `` in this example) to assets. This allows your website
184+ to be hosted anywhere under the web server root directory.
186185
187186Absolute Assets and CDNs
188187~~~~~~~~~~~~~~~~~~~~~~~~
189188
190189Applications that host their assets on different domains and CDNs (*Content
191- Delivery Networks *) should use the :class: `Symfony\C omponent\A sset\U rlPackage `
190+ Delivery Networks *) should use the :class: `Symfony\\ Component\\ Asset\ \ UrlPackage `
192191class to generate absolute URLs for their assets::
193192
194193 use Symfony\Component\Asset\UrlPackage;
@@ -203,8 +202,8 @@ class to generate absolute URLs for their assets::
203202 // result: http://static.example.com/images/logo.png?v1
204203
205204In case you serve assets from more than one domain to improve application
206- performance, pass an array of URLs as the first argument of
207- :class: ` Symfony \C omponent \A sset \U rlPackage ` constructor::
205+ performance, pass an array of URLs as the first argument of `` UrlPackage ``
206+ constructor::
208207
209208 use Symfony\Component\Asset\UrlPackage;
210209 // ...
@@ -248,7 +247,7 @@ Named Packages
248247
249248Applications that manage lots of different assets may need to group them in
250249packages with the same versioning strategy and base path. The Asset component
251- includes a :class: `Symfony\C omponent\A sset\P ackages ` class to simplify the
250+ includes a :class: `Symfony\\ Component\\ Asset\ \ Packages ` class to simplify the
252251management of several packages.
253252
254253In the following example, all packages use the same versioning strategy, but
@@ -271,11 +270,11 @@ they all have different base paths::
271270
272271 $packages = new Packages($defaultPackage, $namedPackages)
273272
274- The :class: ` Symfony \C omponent \A sset \ P ackages ` class allows to define a default
275- package, which will be applied to assets that don't define the name of package
276- to use. In addition, this application defines a package named ``img `` to serve
277- images from an external domain and a ``doc `` package to avoid repeating long
278- paths when linking to a document inside a template::
273+ The `` Packages `` class allows to define a default package, which will be applied
274+ to assets that don't define the name of package to use. In addition, this
275+ application defines a package named ``img `` to serve images from an external
276+ domain and a ``doc `` package to avoid repeating long paths when linking to a
277+ document inside a template::
279278
280279 echo $packages->getUrl('/main.css');
281280 // result: /main.css?v1
0 commit comments