@@ -27,7 +27,7 @@ Configuration
27
27
* `test `_
28
28
* `default_locale `_
29
29
* `trusted_hosts `_
30
- * `form `_
30
+ * :ref: `form < reference-framework-form > `_
31
31
* :ref:`enabled <form.enabled>`
32
32
* `csrf_protection `_
33
33
* :ref: `enabled <form.csrf_protection.enabled >`
@@ -50,15 +50,15 @@ Configuration
50
50
* `ip `_
51
51
* :ref: `path <profiler.matcher.path >`
52
52
* `service `_
53
- * router
54
- * resource
55
- * type
56
- * http_port
57
- * https_port
58
- * strict_requirements
53
+ * ` router `_
54
+ * ` resource `_
55
+ * ` type `_
56
+ * ` http_port `_
57
+ * ` https_port `_
58
+ * ` strict_requirements `_
59
59
* `session `_
60
- * storage_id
61
- * handler_id
60
+ * ` storage_id `_
61
+ * ` handler_id `_
62
62
* `name `_
63
63
* `cookie_lifetime `_
64
64
* `cookie_path `_
@@ -72,15 +72,15 @@ Configuration
72
72
* `templating `_
73
73
* `assets_version `_
74
74
* `assets_version_format `_
75
- * hinclude_default_template
76
- * form
77
- * resources
75
+ * ` hinclude_default_template `_
76
+ * :ref: ` form < templating.form >`_
77
+ * ` resources`_
78
78
* `assets_base_urls`_
79
79
* http
80
80
* ssl
81
- * cache
82
- * engines
83
- * loaders
81
+ * ` cache`_
82
+ * ` engines`_
83
+ * ` loaders`_
84
84
* packages
85
85
* translator
86
86
* enabled
@@ -585,9 +585,85 @@ service
585
585
586
586
This setting contains the service id of a custom matcher.
587
587
588
+ router
589
+ ~~~~~~
590
+
591
+ resource
592
+ ........
593
+
594
+ **type **: ``string `` **required **
595
+
596
+ Specifies the path to the routes used by the default router.
597
+
598
+ It becomes the service container parameter called ``router.resource ``.
599
+
600
+ type
601
+ ....
602
+
603
+ **type **: ``string ``
604
+
605
+ The type of the resource to hint the loaders about the format. This isn't
606
+ needed when you use the default routers with the expected file extensions
607
+ (``.xml ``, ``.yml `` / ``.yaml ``, ``.php ``).
608
+
609
+ http_port
610
+ .........
611
+
612
+ **type **: ``integer `` **default **: ``80 ``
613
+
614
+ The port for normal http requests (this is used when matching the scheme).
615
+
616
+ It becomes the service container parameter called ``router.resource ``.
617
+
618
+ https_port
619
+ ..........
620
+
621
+ **type **: ``integer `` **default **: ``443 ``
622
+
623
+ The port for https requests (this is used when matching the scheme).
624
+
625
+ strict_requirements
626
+ ...................
627
+
628
+ **type **: ``mixed `` **default **: ``true ``
629
+
630
+ Determines the behaviour when a route matches, but the parameters do not match
631
+ the specified requirements for that route. Can be one of:
632
+
633
+ ``true ``
634
+ Throw an exception when the requirements are not met;
635
+ ``false ``
636
+ Disable exceptions when the requirements are not met and return ``null ``
637
+ instead;
638
+ ``null ``
639
+ Disable checking the requirements (thus, match the route even when the
640
+ requirements don't match).
641
+
642
+ ``false `` is recommended in the development environment, while ``false `` or
643
+ ``null `` might be preferred in production.
644
+
588
645
session
589
646
~~~~~~~
590
647
648
+ storage_id
649
+ ..........
650
+
651
+ **type **: ``string `` **default **: ``'session.storage.native' ``
652
+
653
+ The service id used for session storage. The ``session.storage `` service alias
654
+ will be set to this service id.
655
+
656
+ handler_id
657
+ ..........
658
+
659
+ **type **: ``string `` **default **: ``'session.handler.native_file' ``
660
+
661
+ The service id used for session storage. The ``session.handler `` service alias
662
+ will be set to this service id.
663
+
664
+ You can also set it to ``null ``, to default to the handler of your PHP
665
+ installation.
666
+
591
667
name
592
668
....
593
669
@@ -639,6 +715,13 @@ This means that the cookie won't be accessible by scripting languages, such
639
715
as JavaScript. This setting can effectively help to reduce identity theft
640
716
through XSS attacks.
641
717
718
+ gc_divisor
719
+ ..........
720
+
721
+ **type **: ``integer `` **default **: ``100 ``
722
+
723
+ See `gc_probability `_.
724
+
642
725
gc_probability
643
726
..............
644
727
@@ -649,13 +732,6 @@ on every session initialization. The probability is calculated by using
649
732
``gc_probability `` / ``gc_divisor ``, e.g. 1/100 means there is a 1% chance
650
733
that the GC process will start on each request.
651
734
652
- gc_divisor
653
- ..........
654
-
655
- **type **: ``integer `` **default **: ``100 ``
656
-
657
- See `gc_probability `_.
658
-
659
735
gc_maxlifetime
660
736
..............
661
737
@@ -684,7 +760,7 @@ the value to ``null``:
684
760
# app/config/config.yml
685
761
framework :
686
762
session :
687
- save_path : null
763
+ save_path : ~
688
764
689
765
.. code-block :: xml
690
766
@@ -721,31 +797,14 @@ For more details, see :doc:`/cookbook/serializer`.
721
797
templating
722
798
~~~~~~~~~~
723
799
724
- assets_base_urls
725
- ................
726
-
727
- **default **: ``{ http: [], ssl: [] } ``
728
-
729
- This option allows you to define base URLs to be used for assets referenced
730
- from ``http `` and ``ssl `` (``https ``) pages. A string value may be provided in
731
- lieu of a single-element array. If multiple base URLs are provided, Symfony2
732
- will select one from the collection each time it generates an asset's path.
733
-
734
- For your convenience, ``assets_base_urls `` can be set directly with a string or
735
- array of strings, which will be automatically organized into collections of base
736
- URLs for ``http `` and ``https `` requests. If a URL starts with ``https:// `` or
737
- is `protocol-relative `_ (i.e. starts with `// `) it will be added to both
738
- collections. URLs starting with ``http:// `` will only be added to the
739
- ``http `` collection.
740
-
741
800
.. _ref-framework-assets-version :
742
801
743
802
assets_version
744
803
..............
745
804
746
805
**type **: ``string ``
747
806
748
- This option is used to * bust * the cache on assets by globally adding a query
807
+ This option is used to bust the cache on assets by globally adding a query
749
808
parameter to all rendered asset paths (e.g. ``/images/logo.png?v2 ``). This
750
809
applies only to assets rendered via the Twig ``asset `` function (or PHP equivalent)
751
810
as well as assets rendered with Assetic.
@@ -796,19 +855,22 @@ Now, the same asset will be rendered as ``/images/logo.png?v2`` If you use
796
855
this feature, you **must ** manually increment the ``assets_version `` value
797
856
before each deployment so that the query parameters change.
798
857
799
- You can also control how the query string works via the `assets_version_format `_
800
- option.
858
+ .. tip ::
859
+
860
+ As with all settings, you can use a parameter as value for the
861
+ ``assets_version ``. This makes it easier to increment the cache on each
862
+ deployment.
801
863
802
864
assets_version_format
803
865
.....................
804
866
805
867
**type **: ``string `` **default **: ``%%s?%%s ``
806
868
807
- This specifies a :phpfunction: `sprintf ` pattern that will be used with the ` assets_version `_
808
- option to construct an asset's path. By default, the pattern adds the asset's
809
- version as a query string. For example, if `` assets_version_format `` is set to
810
- ``%%s?version=%%s `` and ``assets_version `` is set to `` 5 ``, the asset's path
811
- would be ``/images/logo.png?version=5 ``.
869
+ This specifies a :phpfunction: `sprintf ` pattern that will be used with the
870
+ ` assets_version `_ option to construct an asset's path. By default, the pattern
871
+ adds the asset's version as a query string. For example, if
872
+ ``assets_version_format `` is set to `` %%s?version=%%s `` and ``assets_version ``
873
+ is set to `` 5 ``, the asset's path would be ``/images/logo.png?version=5 ``.
812
874
813
875
.. note ::
814
876
@@ -834,6 +896,119 @@ would be ``/images/logo.png?version=5``.
834
896
The latter option is useful if you would like older asset versions to remain
835
897
accessible at their original URL.
836
898
899
+ hinclude_default_template
900
+ .........................
901
+
902
+ **type **: ``string `` **default **: ``null ``
903
+
904
+ Sets the content shown during the loading of the fragment or when JavaScript is
905
+ disabled. This can be either a template name or the content itself. It becomes
906
+ the service container parameter named ``fragment.renderer.hinclude.global_template ``.
907
+
908
+ .. seealso ::
909
+
910
+ See :ref: `book-templating-hinclude ` for more information about hinclude.
911
+
912
+ .. _templating.form :
913
+
914
+ form
915
+ ....
916
+
917
+
918
+ resources
919
+ """""""""
920
+
921
+ **type **: ``string[] `` **default **: ``[FrameworkBundle:Form] ``
922
+
923
+ A list of all resources for form theming in PHP. If you have custom global form
924
+ themes in ``src/WebsiteBundle/Resources/views/Form ``, you can configure this like:
925
+
926
+ .. configuration-block ::
927
+
928
+ .. code-block :: yaml
929
+
930
+ framework :
931
+ templating :
932
+ form :
933
+ resources :
934
+ - ' WebsiteBundle:Form'
935
+
936
+ .. code-block :: xml
937
+
938
+ <framework : config >
939
+ <framework : templating >
940
+ <framework : form >
941
+ <framework : resource >WebsiteBundle:Form</framework : resource >
942
+ </framework : form >
943
+ </framework : templating >
944
+ </framework : config >
945
+
946
+ .. code-block :: php
947
+
948
+ $container->loadFromExtension('framework', array(
949
+ 'templating' => array(
950
+ 'form' => array(
951
+ 'resources' => array(
952
+ 'WebsiteBundle:Form'
953
+ ),
954
+ ),
955
+ ),
956
+ ));
957
+
958
+ .. note ::
959
+
960
+ The default form templates from ``FrameworkBundle:Form `` will always be
961
+ included in the form resources.
962
+
963
+ assets_base_urls
964
+ ................
965
+
966
+ **type **: ``{ http: [], ssl: [] } ``
967
+
968
+ This option allows you to define base URLs to be used for assets referenced
969
+ from ``http `` and ``ssl `` (``https ``) pages. A string value may be provided in
970
+ lieu of a single-element array. If multiple base URLs are provided, Symfony2
971
+ will select one from the collection each time it generates an asset's path.
972
+
973
+ For your convenience, ``assets_base_urls `` can be set directly with a string or
974
+ array of strings, which will be automatically organized into collections of base
975
+ URLs for ``http `` and ``https `` requests. If a URL starts with ``https:// `` or
976
+ is `protocol-relative `_ (i.e. starts with ``// ``), it will be added to both
977
+ collections. URLs starting with ``http:// `` will only be added to the
978
+ ``http `` collection.
979
+
980
+ cache
981
+ .....
982
+
983
+ **type **: ``string ``
984
+
985
+ The path to the cache directory for templates. When this is not set, caching is
986
+ disabled. It becomes the service container parameter named
987
+ ``templating.loader.cache.path ``.
988
+
989
+ engines
990
+ .......
991
+
992
+ **type **: ``string[] `` / ``string `` **required **
993
+
994
+ The Templating Engine to use. This can either be a string (when only one engine
995
+ is configured) or an array of engines. It becomes the service container
996
+ parameter named ``templating.engines ``.
997
+
998
+ At least one engine is required.
999
+
1000
+ loaders
1001
+ .......
1002
+
1003
+ **type **: ``string[] ``
1004
+
1005
+ An array (or a string when configuring just one loader) of service ids for
1006
+ templating loaders.
1007
+
1008
+ packages
1009
+ ........
1010
+
1011
+
837
1012
.. _`protocol-relative` : http://tools.ietf.org/html/rfc3986#section-4.2
838
1013
.. _`PhpStormOpener` : https://github.com/pinepain/PhpStormOpener
839
1014
.. _`HTTP Host header attacks` : http://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
0 commit comments