Skip to content

Commit 5d06eb5

Browse files
author
Henry Snoek
committed
document base_path option
1 parent cc12d7f commit 5d06eb5

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

reference/configuration/framework.rst

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Configuration
7070
* `gc_maxlifetime`_
7171
* `save_path`_
7272
* `assets`_
73+
* `base_path`_
7374
* `base_urls`_
7475
* `packages`_
7576
* `version`_
@@ -852,6 +853,48 @@ setting the value to ``null``:
852853
assets
853854
~~~~~~
854855

856+
.. _reference-assets-base-path:
857+
858+
base_path
859+
.........
860+
861+
**type**: ``string``
862+
863+
This option allows you to define a base path to be used for assets:
864+
865+
.. configuration-block::
866+
867+
.. code-block:: yaml
868+
869+
# app/config/config.yml
870+
framework:
871+
# ...
872+
assets:
873+
base_path: '/images'
874+
875+
.. code-block:: xml
876+
877+
<!-- app/config/config.xml -->
878+
<?xml version="1.0" encoding="UTF-8" ?>
879+
<container xmlns="http://symfony.com/schema/dic/services"
880+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
881+
xmlns:framework="http://symfony.com/schema/dic/symfony"
882+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
883+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
884+
885+
<framework:assets base_path="/images">
886+
</container>
887+
888+
.. code-block:: php
889+
890+
// app/config/config.php
891+
$container->loadFromExtension('framework', array(
892+
// ...
893+
'assets' => array(
894+
'base_path' => '/images',
895+
),
896+
));
897+
855898
.. _reference-templating-base-urls:
856899
.. _reference-assets-base-urls:
857900

@@ -967,6 +1010,7 @@ Now you can use the ``avatars`` package in your templates:
9671010

9681011
Each package can configure the following options:
9691012

1013+
* :ref:`base_path <reference-assets-base-path>`
9701014
* :ref:`base_urls <reference-assets-base-urls>`
9711015
* :ref:`version <reference-framework-assets-version>`
9721016
* :ref:`version_format <reference-assets-version-format>`
@@ -1526,16 +1570,18 @@ Full Default Configuration
15261570
15271571
# assets configuration
15281572
assets:
1573+
base_path: ~
1574+
base_urls: []
15291575
version: ~
15301576
version_format: '%%s?%%s'
1531-
base_urls: []
15321577
packages:
15331578
15341579
# Prototype
15351580
name:
1581+
base_path: ~
1582+
base_urls: []
15361583
version: ~
15371584
version_format: '%%s?%%s'
1538-
base_urls: []
15391585
15401586
# templating configuration
15411587
templating:

0 commit comments

Comments
 (0)