@@ -1256,81 +1256,6 @@ templating loaders. Templating loaders are used to find and load templates
12561256from a resource (e.g. a filesystem or database). Templating loaders must
12571257implement:class: `Symfony\\ Component\\ Templating\\ Loader\\ LoaderInterface `.
12581258
1259- .. _reference-framework-assets-packages :
1260-
1261- packages
1262- ........
1263-
1264- You can group assets into packages, to specify different base URLs for them:
1265-
1266- ..configuration-block ::
1267-
1268- ..code-block ::yaml
1269-
1270- # app/config/config.yml
1271- framework :
1272- # ...
1273- templating :
1274- packages :
1275- avatars :
1276- base_urls :' http://static_cdn.example.com/avatars'
1277-
1278- ..code-block ::xml
1279-
1280- <!-- app/config/config.xml-->
1281- <?xml version =" 1.0" encoding =" UTF-8" ?>
1282- <container xmlns =" http://symfony.com/schema/dic/services"
1283- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
1284- xmlns : framework =" http://symfony.com/schema/dic/symfony"
1285- xsi : schemaLocation =" http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
1286- http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
1287-
1288- <framework : config >
1289-
1290- <framework : templating >
1291-
1292- <framework : package
1293- name =" avatars"
1294- base-url =" http://static_cdn.example.com/avatars" >
1295-
1296- </framework : templating >
1297-
1298- </framework : config >
1299- </container >
1300-
1301- ..code-block ::php
1302-
1303- // app/config/config.php
1304- $container->loadFromExtension('framework', array(
1305- // ...
1306- 'templating' => array(
1307- 'packages' => array(
1308- 'avatars' => array(
1309- 'base_urls' => 'http://static_cdn.example.com/avatars',
1310- ),
1311- ),
1312- ),
1313- ));
1314-
1315- Now you can use the ``avatars `` package in your templates:
1316-
1317- ..configuration-block ::php
1318-
1319- ..code-block ::html+jinja
1320-
1321- <img src="{{ asset('...', 'avatars') }}">
1322-
1323- ..code-block ::html+php
1324-
1325- <img src="<?php echo $view['assets']->getUrl('...', 'avatars') ?>">
1326-
1327- Each package can configure the following options:
1328-
1329- *:ref: `base_urls <reference-templating-base-urls >`
1330- *:ref: `version <reference-framework-assets-version >`
1331- *:ref: `version_format <reference-templating-version-format >`
1332-
1333- >>>>>>> Cookbook entry: Asset - Custom Version Strategy
13341259translator
13351260~~~~~~~~~~
13361261