8000 [reference] Add documentation for assets_base_urls option · web-dev/symfony-docs@f6110f3 · GitHub
[go: up one dir, main page]

Skip to content

Commit f6110f3

Browse files
committed
[reference] Add documentation for assets_base_urls option
I decided to gloss over the details of how a single base URL is selected from a collection when generating an asset's path, as the internal behavior of UrlPackage is just that.
1 parent 2dc0a86 commit f6110f3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

reference/configuration/framework.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Configuration
2727
* `session`_
2828
* `lifetime`_
2929
* `templating`_
30+
* `assets_base_urls`_
3031
* `assets_version`_
3132
* `assets_version_format`_
3233

@@ -106,6 +107,23 @@ This determines the lifetime of the session - in seconds.
106107
templating
107108
~~~~~~~~~~
108109

110+
assets_base_urls
111+
................
112+
113+
**default**: ``{ http: [], https: [] }``
114+
115+
This option allows you to define base URL's to be used for assets referenced
116+
from ``http`` and ``https`` pages. A string value may be provided in lieu of a
117+
single-element array. If multiple base URL's are provided, Symfony2 will select
118+
one from the collection each time it generates an asset's path.
119+
120+
For your convenience, ``assets_base_urls`` can be set directly with a string or
121+
array of strings, which will be automatically organized into collections of base
122+
URL's for ``http`` and ``https`` requests. If a URL starts with ``https://`` or
123+
is `protocol-relative`_ (i.e. starts with `//`) it will be added to both
124+
collections. URL's starting with ``http://`` will only be added to the
125+
``http`` collection.
126+
109127
.. _ref-framework-assets-version:
110128

111129
assets_version
@@ -302,4 +320,5 @@ Full Default Configuration
302320
file_cache_dir: %kernel.cache_dir%/annotations
303321
debug: true
304322
323+
.. _`protocol-relative`: http://tools.ietf.org/html/rfc3986#section-4.2
305324
.. _`sprintf()`: http://php.net/manual/en/function.sprintf.php

0 commit comments

Comments
 (0)
0