File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -312,8 +312,12 @@ You can now use the ``asset()`` function:
312312 {# the JS file lives at "public/bundles/acme/js/loader.js" #}
313313 <script src="{{ asset('bundles/acme/js/loader.js') }}"></script>
314314
315- The ``asset() `` function's main purpose is to make your application more portable.
316- If your application lives at the root of your host (e.g. ``https://example.com ``),
315+ Using the ``asset() `` function is recommended for two reasons:
316+
317+ * It automatically takes care of versioning your assets with
318+ :doc: `Symfony's AssetMapper </frontend >`
319+
320+ * If your application lives at the root of your host (e.g. ``https://example.com ``),
317321then the rendered path should be ``/images/logo.png ``. But if your application
318322lives in a subdirectory (e.g. ``https://example.com/my_app ``), each asset path
319323should render with the subdirectory (e.g. ``/my_app/images/logo.png ``). The
You can’t perform that action at this time.
0 commit comments