8000 Fixed RST syntax issues · symfony/symfony-docs@9e8de96 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e8de96

Browse files
javiereguiluzweaverryan
authored andcommitted
Fixed RST syntax issues
1 parent 5ca85d1 commit 9e8de96

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

components/asset/introduction.rst

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ assets are cached.
8383

8484
Instead of relying on a simple version mechanism, the Asset component allows to
8585
define advanced versioning strategies via PHP classes. The two built-in strategies
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`,
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`,
8888
which allows to set the version with a format string.
8989

90-
In this example, the :class:`Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy`
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

101101
In case you want to modify the version format, pass a sprintf-compatible format
102-
string as the second argument of the
103-
:class:`Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy` 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
117116
Custom Version Strategies
118117
.........................
119118

120-
Use the :class:`Symfony\Component\Asset\VersionStrategy\VersionStrategyInterface`
119+
Use the :class:`Symfony\\Component\\Asset\\VersionStrategy\\VersionStrategyInterface`
121120
to define your own version strategy. For example, you could define a versioning
122121
where the current date is appended to bust the cache every day::
123122

@@ -147,9 +146,9 @@ Grouped Assets
147146
~~~~~~~~~~~~~~
148147

149148
It's common for applications to store their assets in a common path. If that's
150-
your case, replace the default :class:`Symfony\Component\Asset\Package` class by
151-
:class:`Symfony\Component\Asset\PathPackage` 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

165164
If you are also using the HttpFoundation component in your project, for example
166-
in a Symfony application, the :class:`Symfony\Component\Asset\PathPackage` 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

182181
When the request context is set (via the third optional argument), in addition
183-
to the configured base path, :class:`Symfony\Component\Asset\PathPackage` 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

187186
Absolute Assets and CDNs
188187
~~~~~~~~~~~~~~~~~~~~~~~~
189188

190189
Applications that host their assets on different domains and CDNs (*Content
191-
Delivery Networks*) should use the :class:`Symfony\Component\Asset\UrlPackage`
190+
Delivery Networks*) should use the :class:`Symfony\\Component\\Asset\\UrlPackage`
192191
class 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

205204
In 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\Component\Asset\UrlPackage` 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

249248
Applications that manage lots of different assets may need to group them in
250249
packages with the same versioning strategy and base path. The Asset component
251-
includes a :class:`Symfony\Component\Asset\Packages` class to simplify the
250+
includes a :class:`Symfony\\Component\\Asset\\Packages` class to simplify the
252251
management of several packages.
253252

254253
In 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\Component\Asset\Packages` 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

Comments
 (0)
0