Skip to content

Commit f223643

Browse files
committed
Apply some of Ryan's suggestions
1 parent 7e45e8f commit f223643

File tree

1 file changed

+111
-14
lines changed

1 file changed

+111
-14
lines changed

reference/configuration/framework.rst

+111-14
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ settings is configured.
387387

388388
.. note::
389389

390-
This will automatically enable the validation.
390+
This will automatically enable the `validation`_.
391391

392392
.. seealso::
393393

@@ -543,10 +543,10 @@ cookie_lifetime
543543

544544
**type**: ``integer`` **default**: ``null``
545545

546-
This determines the lifetime of the session - in seconds. It will use ``null``
547-
by default, which means ``session.cookie_lifetime`` value from ``php.ini`` will
548-
be used. Setting this value to ``0`` means the cookie is valid for the length
549-
of the browser session.
546+
This determines the lifetime of the session - in seconds. The default value -
547+
``null`` - means that the ``sesssion.cookie_lifetime`` value from ``php.ini``
548+
will be used. Setting this value to ``0`` means the cookie is valid for the
549+
length of the browser session.
550550

551551
cookie_path
552552
...........
@@ -679,16 +679,108 @@ assets_base_urls
679679
**default**: ``{ http: [], ssl: [] }``
680680

681681
This option allows you to define base URLs to be used for assets referenced
682-
from ``http`` and ``ssl`` (``https``) pages. A string value may be provided in
683-
lieu of a single-element array. If multiple base URLs are provided, Symfony2
684-
will select one from the collection each time it generates an asset's path.
682+
from ``http`` and ``ssl`` (``https``) pages. If multiple base URLs are
683+
provided, Symfony will select one from the collection each time it generates
684+
an asset's path:
685685

686-
For your convenience, ``assets_base_urls`` can be set directly with a string or
687-
array of strings, which will be automatically organized into collections of base
688-
URLs for ``http`` and ``https`` requests. If a URL starts with ``https://`` or
689-
is `protocol-relative`_ (i.e. starts with ``//``), it will be added to both
690-
collections. URLs starting with ``http://`` will only be added to the
691-
``http`` collection.
686+
.. configuration-block::
687+
688+
.. code-block:: yaml
689+
690+
# app/config/config.yml
691+
framework:
692+
# ...
693+
templating:
694+
assets_base_urls:
695+
http:
696+
- "http://cdn.example.com/"
697+
# you can also pass just a string:
698+
# assets_base_urls:
699+
# http: "//cdn.example.com/"
700+
701+
.. code-block:: xml
702+
703+
<!-- app/config/config.xml -->
704+
<?xml version="1.0" encoding="UTF-8" ?>
705+
<container xmlns="http://symfony.com/schema/dic/services"
706+
xmlns:framework="http://symfony.com/schema/dic/symfony">
707+
708+
<framework:config>
709+
<!-- ... -->
710+
711+
<framework:templating>
712+
<framework:assets-base-url>
713+
<framework:http>http://cdn.example.com/</framework:http>
714+
</framework:assets-base-url>
715+
</framework:templating>
716+
</framework:config>
717+
</container>
718+
719+
.. code-block:: php
720+
721+
// app/config/config.php
722+
$container->loadFromExtension('framework', array(
723+
// ...
724+
'templating' => array(
725+
'assets_base_urls' => array(
726+
'http' => array(
727+
'http://cdn.example.com/',
728+
),
729+
),
730+
// you can also pass just a string:
731+
// 'assets_base_urls' => array(
732+
// 'http' => '//cdn.example.com/',
733+
// ),
734+
),
735+
));
736+
737+
For your convenience, you can pass a string or array of strings to
738+
``assets_base_urls`` directly. This will automatically be organized into the
739+
``http`` and ``ssl`` base urls (``https://`` and `protocol-relative`_ URLs will
740+
be added to both collections and ``http://`` only to the ``http`` collection):
741+
742+
.. configuration-block::
743+
744+
.. code-block:: yaml
745+
746+
# app/config/config.yml
747+
framework:
748+
# ...
749+
templating:
750+
assets_base_urls:
751+
- "//cdn.example.com/"
752+
# you can also pass just a string:
753+
# assets_base_urls: "//cdn.example.com/"
754+
755+
.. code-block:: xml
756+
757+
<!-- app/config/config.xml -->
758+
<?xml version="1.0" encoding="UTF-8" ?>
759+
<container xmlns="http://symfony.com/schema/dic/services"
760+
xmlns:framework="http://symfony.com/schema/dic/symfony">
761+
762+
<framework:config>
763+
<!-- ... -->
764+
765+
<framework:templating>
766+
<framework:assets-base-url>//cdn.example.com/</framework:assets-base-url>
767+
</framework:templating>
768+
</framework:config>
769+
</container>
770+
771+
.. code-block:: php
772+
773+
// app/config/config.php
774+
$container->loadFromExtension('framework', array(
775+
// ...
776+
'templating' => array(
777+
'assets_base_urls' => array(
778+
'//cdn.example.com/',
779+
),
780+
// you can also pass just a string:
781+
// 'assets_base_urls' => '//cdn.example.com/',
782+
),
783+
));
692784
693785
.. _reference-templating-cache:
694786

@@ -700,6 +792,11 @@ cache
700792
The path to the cache directory for templates. When this is not set, caching is
701793
disabled.
702794

795+
.. note::
796+
797+
When using Twig templating, the caching is already handled by the
798+
TwigBundle and doesn't need to be enabled for the FrameworkBundle.
799+
703800
engines
704801
.......
705802

0 commit comments

Comments
 (0)