From 73ac342a9610fb4c91e013cb3eeee86159a6389f Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 17 Sep 2017 21:41:53 -0400 Subject: [PATCH 1/9] Moving reverse proxies --- _build/redirection_map | 4 +++- .../load_balancer_reverse_proxy.rst => deployment/proxies.rst | 0 2 files changed, 3 insertions(+), 1 deletion(-) rename request/load_balancer_reverse_proxy.rst => deployment/proxies.rst (100%) diff --git a/_build/redirection_map b/_build/redirection_map index 81af4e938fb..169581736ce 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -183,7 +183,7 @@ /cookbook/profiler/storage /profiler/storage /cookbook/psr7 /request/psr7 /cookbook/request/index /request -/cookbook/request/load_balancer_reverse_proxy /request/load_balancer_reverse_proxy +/cookbook/request/load_balancer_reverse_proxy /deployment/proxies /cookbook/request/mime_type /request/mime_type /cookbook/routing/conditions /routing/conditions /cookbook/routing/custom_route_loader /routing/custom_route_loader @@ -303,6 +303,7 @@ /components/form/type_guesser /form/type_guesser /components/http_foundation/index /components/http_foundation /components/http_foundation/introduction /components/http_foundation +/components/http_foundation/trusting_proxies /deployment/proxies /components/http_kernel/introduction /components/http_kernel /components/http_kernel/index /components/http_kernel /components/property_access/introduction /components/property_access @@ -327,3 +328,4 @@ /form /forms /testing/simulating_authentication /testing/http_authentication /validation/group_service_resolver /form/validation_group_service_resolver +/request/load_balancer_reverse_proxy /deployment/proxies \ No newline at end of file diff --git a/request/load_balancer_reverse_proxy.rst b/deployment/proxies.rst similarity index 100% rename from request/load_balancer_reverse_proxy.rst rename to deployment/proxies.rst From 0059a292bdfa651b75debd3c1f9f983642123e5d Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sat, 23 Sep 2017 14:55:19 -0400 Subject: [PATCH 2/9] TODO - refactoring request article --- reference/configuration/framework.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 18a8595d5cb..fb6f847be4f 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -50,6 +50,8 @@ Configuration * `ip`_ * :ref:`path ` * `service`_ +* `request`_: + * `formats`_ * `router`_ * `resource`_ * `type`_ @@ -647,6 +649,16 @@ service This setting contains the service id of a custom matcher. +request +~~~~~~~ + +formats +....... + +**type**: ``array`` **default**: ``[]`` + +---> TODO + router ~~~~~~ From 7d46a712c821d10c16c12b7d00670a217c57f2d6 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 22 Oct 2017 17:16:53 -0400 Subject: [PATCH 3/9] Removing mime type article and simply moving into reference config --- _build/redirection_map | 2 +- reference/configuration/framework.rst | 10 ++- request/mime_type.rst | 118 -------------------------- 3 files changed, 10 insertions(+), 120 deletions(-) delete mode 100644 request/mime_type.rst diff --git a/_build/redirection_map b/_build/redirection_map index 169581736ce..feecdba57c9 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -184,7 +184,7 @@ /cookbook/psr7 /request/psr7 /cookbook/request/index /request /cookbook/request/load_balancer_reverse_proxy /deployment/proxies -/cookbook/request/mime_type /request/mime_type +/cookbook/request/mime_type /reference/configuration/framework#formats /cookbook/routing/conditions /routing/conditions /cookbook/routing/custom_route_loader /routing/custom_route_loader /cookbook/routing/debug /routing/debug diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index fb6f847be4f..f8f8e9d90e3 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -657,7 +657,15 @@ formats **type**: ``array`` **default**: ``[]`` ----> TODO +This setting is used to associate additional request formats (e.g. ``html``) +to one or more mime types (e.g. ``text/html``), which will allow you to use the +format & mime types to call +:method:`Request::getFormat($mimeType) ` or +:method:`Request::getMimeType($format) `. +In practice, this is important because Symfony uses it to automatically set the +``Content-Type`` header on the ``Response`` (if you don't explicitly set one). +If you pass an array of mime types, the first will be used for the header. + router ~~~~~~ diff --git a/request/mime_type.rst b/request/mime_type.rst deleted file mode 100644 index ea431d070f8..00000000000 --- a/request/mime_type.rst +++ /dev/null @@ -1,118 +0,0 @@ -.. index:: - single: Request; Add a request format and mime type - -How to Register a new Request Format and Mime Type -================================================== - -Every ``Request`` has a "format" (e.g. ``html``, ``json``), which is used -to determine what type of content to return in the ``Response``. In fact, -the request format, accessible via -:method:`Symfony\\Component\\HttpFoundation\\Request::getRequestFormat`, -is used to set the MIME type of the ``Content-Type`` header on the ``Response`` -object. Internally, Symfony contains a map of the most common formats (e.g. -``html``, ``json``) and their associated MIME types (e.g. ``text/html``, -``application/json``). Of course, additional format-MIME type entries can -easily be added. This document will show how you can add the ``jsonp`` format -and corresponding MIME type. - -Configure your New Format -------------------------- - -The FrameworkBundle registers a subscriber that will add formats to incoming requests. - -All you have to do is to configure the ``jsonp`` format: - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/config.yml - framework: - request: - formats: - jsonp: 'application/javascript' - - .. code-block:: xml - - - - - - - - - - application/javascript - - - - - - .. code-block:: php - - // app/config/config.php - $container->loadFromExtension('framework', array( - 'request' => array( - 'formats' => array( - 'jsonp' => 'application/javascript', - ), - ), - )); - -.. tip:: - - You can also associate multiple mime types to a format, but please note that - the preferred one must be the first as it will be used as the content type: - - .. configuration-block:: - - .. code-block:: yaml - - # app/config/config.yml - framework: - request: - formats: - csv: ['text/csv', 'text/plain'] - - .. code-block:: xml - - - - - - - - - - text/csv - text/plain - - - - - - .. code-block:: php - - // app/config/config.php - $container->loadFromExtension('framework', array( - 'request' => array( - 'formats' => array( - 'jsonp' => array( - 'text/csv', - 'text/plain', - ), - ), - ), - )); From a6d03a176c05fcc2bc88b6f379a69687839fe12a Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 22 Oct 2017 17:20:15 -0400 Subject: [PATCH 4/9] Moving PSR7 into components --- _build/redirection_map | 2 +- {request => components}/psr7.rst | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename {request => components}/psr7.rst (95%) diff --git a/_build/redirection_map b/_build/redirection_map index feecdba57c9..6e4d3ca79f8 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -181,7 +181,7 @@ /cookbook/profiler/matchers /profiler/matchers /cookbook/profiler/profiling_data /profiler/profiling_data /cookbook/profiler/storage /profiler/storage -/cookbook/psr7 /request/psr7 +/cookbook/psr7 /components/psr7 /cookbook/request/index /request /cookbook/request/load_balancer_reverse_proxy /deployment/proxies /cookbook/request/mime_type /reference/configuration/framework#formats diff --git a/request/psr7.rst b/components/psr7.rst similarity index 95% rename from request/psr7.rst rename to components/psr7.rst index 7eaa9f7343c..32b008413d9 100644 --- a/request/psr7.rst +++ b/components/psr7.rst @@ -13,7 +13,7 @@ Installation You can install the component in 2 different ways: -* :doc:`Install it via Composer ` (`symfony/psr-http-message-bridge on Packagist `_); +* :doc:`Install it via Composer ` (`symfony/psr-http-message-bridge on Packagist`_); * Use the official Git repository (https://github.com/symfony/psr-http-message-bridge). The bridge also needs a PSR-7 implementation to allow converting HttpFoundation @@ -87,3 +87,4 @@ to a :class:`Symfony\\Component\\HttpFoundation\\Response` instance:: .. _`PSR-7`: http://www.php-fig.org/psr/psr-7/ .. _`Zend Diactoros`: https://github.com/zendframework/zend-diactoros +.. _`symfony/psr-http-message-bridge on Packagist`: https://packagist.org/packages/symfony/psr-http-message-bridge From e81ce7659c9d966aef56c8018b3f51d0c55e7ca2 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 22 Oct 2017 17:27:28 -0400 Subject: [PATCH 5/9] moving assetic --- _build/redirection_map | 21 ++++++++++++------- frontend.rst | 3 +-- assetic.rst => frontend/assetic.rst | 0 .../assetic}/apply_to_option.rst | 0 .../assetic}/asset_management.rst | 0 .../assetic}/jpeg_optimize.rst | 0 {assetic => frontend/assetic}/php.rst | 0 {assetic => frontend/assetic}/uglifyjs.rst | 0 .../assetic}/yuicompressor.rst | 0 9 files changed, 15 insertions(+), 9 deletions(-) rename assetic.rst => frontend/assetic.rst (100%) rename {assetic => frontend/assetic}/apply_to_option.rst (100%) rename {assetic => frontend/assetic}/asset_management.rst (100%) rename {assetic => frontend/assetic}/jpeg_optimize.rst (100%) rename {assetic => frontend/assetic}/php.rst (100%) rename {assetic => frontend/assetic}/uglifyjs.rst (100%) rename {assetic => frontend/assetic}/yuicompressor.rst (100%) diff --git a/_build/redirection_map b/_build/redirection_map index 81af4e938fb..12f81a242d6 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -76,13 +76,20 @@ /book/configuration /configuration /book/propel /propel/propel /book/performance /performance -/cookbook/assetic/apply_to_option /assetic/apply_to_option -/cookbook/assetic/asset_management /assetic/asset_management -/cookbook/assetic/index /assetic -/cookbook/assetic/jpeg_optimize /assetic/jpeg_optimize -/cookbook/assetic/php /assetic/php -/cookbook/assetic/uglifyjs /assetic/uglifyjs -/cookbook/assetic/yuicompressor /assetic/yuicompressor +/cookbook/assetic/apply_to_option /frontend/assetic/apply_to_option +/cookbook/assetic/asset_management /frontend/assetic/asset_management +/cookbook/assetic/index /frontend/assetic +/cookbook/assetic/jpeg_optimize /frontend/assetic/jpeg_optimize +/cookbook/assetic/php /frontend/assetic/php +/cookbook/assetic/uglifyjs /frontend/assetic/uglifyjs +/cookbook/assetic/yuicompressor /frontend/assetic/yuicompressor +/assetic /frontend/assetic +/assetic/apply_to_option /frontend/assetic/apply_to_option +/assetic/asset_management /frontend/assetic/asset_management +/assetic/jpeg_optimize /frontend/assetic/jpeg_optimize +/assetic/php /frontend/assetic/php +/assetic/uglifyjs /frontend/assetic/uglifyjs +/assetic/yuicompressor /frontend/assetic/yuicompressor /cookbook/bundles/best_practices /bundles/best_practices /cookbook/bundles/configuration /bundles/configuration /cookbook/bundles/extension /bundles/extension diff --git a/frontend.rst b/frontend.rst index d6384a72d33..24fa00fdb86 100644 --- a/frontend.rst +++ b/frontend.rst @@ -2,5 +2,4 @@ Front-end ========= See the latest version of the docs for frontend tools. Or, see -:doc:`/assetic`. - +:doc:`/frontend/assetic`. diff --git a/assetic.rst b/frontend/assetic.rst similarity index 100% rename from assetic.rst rename to frontend/assetic.rst diff --git a/assetic/apply_to_option.rst b/frontend/assetic/apply_to_option.rst similarity index 100% rename from assetic/apply_to_option.rst rename to frontend/assetic/apply_to_option.rst diff --git a/assetic/asset_management.rst b/frontend/assetic/asset_management.rst similarity index 100% rename from assetic/asset_management.rst rename to frontend/assetic/asset_management.rst diff --git a/assetic/jpeg_optimize.rst b/frontend/assetic/jpeg_optimize.rst similarity index 100% rename from assetic/jpeg_optimize.rst rename to frontend/assetic/jpeg_optimize.rst diff --git a/assetic/php.rst b/frontend/assetic/php.rst similarity index 100% rename from assetic/php.rst rename to frontend/assetic/php.rst diff --git a/assetic/uglifyjs.rst b/frontend/assetic/uglifyjs.rst similarity index 100% rename from assetic/uglifyjs.rst rename to frontend/assetic/uglifyjs.rst diff --git a/assetic/yuicompressor.rst b/frontend/assetic/yuicompressor.rst similarity index 100% rename from assetic/yuicompressor.rst rename to frontend/assetic/yuicompressor.rst From d2ddd681de22fe0606b5fc20e49f34d69d4d5d0a Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 22 Oct 2017 17:33:12 -0400 Subject: [PATCH 6/9] moving expressions --- _build/redirection_map | 3 ++- expressions.rst => security/expressions.rst | 26 ++++----------------- 2 files changed, 7 insertions(+), 22 deletions(-) rename expressions.rst => security/expressions.rst (79%) diff --git a/_build/redirection_map b/_build/redirection_map index 12f81a242d6..4c5ec3c4d67 100644 --- a/_build/redirection_map +++ b/_build/redirection_map @@ -157,7 +157,8 @@ /cookbook/event_dispatcher/event_listener /event_dispatcher /cookbook/event_dispatcher/index /event_dispatcher /cookbook/event_dispatcher/method_behavior /event_dispatcher/method_behavior -/cookbook/expressions /expressions/expressions +/cookbook/expressions /security/expressions +/expressions /security/expressions /cookbook/form/create_custom_field_type /form/create_custom_field_type /cookbook/form/create_form_type_extension /form/create_form_type_extension /cookbook/form/data_transformers /form/data_transformers diff --git a/expressions.rst b/security/expressions.rst similarity index 79% rename from expressions.rst rename to security/expressions.rst index b61335bbdc2..e9ea4fdb6b8 100644 --- a/expressions.rst +++ b/security/expressions.rst @@ -1,29 +1,13 @@ .. index:: single: Expressions in the Framework -How to use Expressions in Security, Routing, Services, and Validation -===================================================================== - -In Symfony 2.4, a powerful :doc:`ExpressionLanguage ` -component was added to Symfony. This allows us to add highly customized -logic inside configuration. - -The Symfony Framework leverages expressions out of the box in the following -ways: - -* :doc:`Configuring services `; -* :doc:`Route matching conditions `; -* :ref:`Checking security ` (explained below) and - :ref:`access controls with allow_if `; -* :doc:`Validation `. - -For more information about how to create and work with expressions, see -:doc:`/components/expression_language/syntax`. +Security: Complex Access Controls with Expressions +================================================== -.. _expressions-security: +.. seealso:: -Security: Complex Access Controls with Expressions --------------------------------------------------- + The best solution for handling complex authorization rules is to use + the :doc:`Voter System `. In addition to a role like ``ROLE_ADMIN``, the ``isGranted()`` method also accepts an :class:`Symfony\\Component\\ExpressionLanguage\\Expression` object:: From 2546a513656d00f6ae277df1bf91a5448545f4ba Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 22 Oct 2017 20:05:16 -0400 Subject: [PATCH 7/9] fixing references --- best_practices/web-assets.rst | 6 +++--- components/expression_language.rst | 1 - components/http_foundation.rst | 1 - components/http_foundation/trusting_proxies.rst | 2 +- frontend.rst | 7 +++++++ frontend/assetic/asset_management.rst | 4 ++-- frontend/assetic/yuicompressor.rst | 2 +- index.rst | 2 -- quick_tour/the_view.rst | 2 +- reference/configuration/framework.rst | 2 +- reference/dic_tags.rst | 2 +- reference/twig_reference.rst | 2 +- security.rst | 2 +- templating.rst | 2 +- 14 files changed, 20 insertions(+), 17 deletions(-) diff --git a/best_practices/web-assets.rst b/best_practices/web-assets.rst index 62398ebed93..22c95fddd62 100644 --- a/best_practices/web-assets.rst +++ b/best_practices/web-assets.rst @@ -49,7 +49,7 @@ tools like GruntJS. Use Assetic to compile, combine and minimize web assets, unless you're comfortable with frontend tools like GruntJS. -:doc:`Assetic ` is an asset manager capable +:doc:`Assetic ` is an asset manager capable of compiling assets developed with a lot of different frontend technologies like LESS, Sass and CoffeeScript. Combining all your assets with Assetic is a matter of wrapping all the assets with a single Twig tag: @@ -87,8 +87,8 @@ Learn More about Assetic ------------------------ Assetic can also minimize CSS and JavaScript assets -:doc:`using UglifyCSS/UglifyJS ` to speed up your -websites. You can even :doc:`compress images ` +:doc:`using UglifyCSS/UglifyJS ` to speed up your +websites. You can even :doc:`compress images ` with Assetic to reduce their size before serving them to the user. Check out the `official Assetic documentation`_ to learn more about all the available features. diff --git a/components/expression_language.rst b/components/expression_language.rst index ad7f3f924f6..348096e5dd9 100644 --- a/components/expression_language.rst +++ b/components/expression_language.rst @@ -119,7 +119,6 @@ Learn More :maxdepth: 1 :glob: - /expressions /components/expression_language/* /service_container/expression_language /reference/constraints/Expression diff --git a/components/http_foundation.rst b/components/http_foundation.rst index 6d2b6797ea0..224632f55d8 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -611,7 +611,6 @@ Learn More /components/http_foundation/* /controller /controller/* - /request/* /session/* /http_cache/* diff --git a/components/http_foundation/trusting_proxies.rst b/components/http_foundation/trusting_proxies.rst index 9fc5ead0f36..13dda122fc7 100644 --- a/components/http_foundation/trusting_proxies.rst +++ b/components/http_foundation/trusting_proxies.rst @@ -7,7 +7,7 @@ Trusting Proxies .. tip:: If you're using the Symfony Framework, start by reading - :doc:`/request/load_balancer_reverse_proxy`. + :doc:`/deployment/proxies`. If you find yourself behind some sort of proxy - like a load balancer - then certain header information may be sent to you using special ``X-Forwarded-*`` diff --git a/frontend.rst b/frontend.rst index 24fa00fdb86..c09d6bb2605 100644 --- a/frontend.rst +++ b/frontend.rst @@ -3,3 +3,10 @@ Front-end See the latest version of the docs for frontend tools. Or, see :doc:`/frontend/assetic`. + +.. toctree:: + :maxdepth: 1 + :glob: + :hidden: + + frontend/* diff --git a/frontend/assetic/asset_management.rst b/frontend/assetic/asset_management.rst index 88b11a4cfdd..d3fb1e8f6e8 100644 --- a/frontend/assetic/asset_management.rst +++ b/frontend/assetic/asset_management.rst @@ -181,7 +181,7 @@ To include an image you can use the ``image`` tag. You can also use Assetic for image optimization. More information in -:doc:`/assetic/jpeg_optimize`. +:doc:`/frontend/assetic/jpeg_optimize`. .. tip:: @@ -441,7 +441,7 @@ into your template: A more detailed guide about configuring and using Assetic filters as well as -details of Assetic's debug mode can be found in :doc:`/assetic/uglifyjs`. +details of Assetic's debug mode can be found in :doc:`/frontend/assetic/uglifyjs`. Controlling the URL Used ------------------------ diff --git a/frontend/assetic/yuicompressor.rst b/frontend/assetic/yuicompressor.rst index 392db7cdeee..25b056ab54c 100644 --- a/frontend/assetic/yuicompressor.rst +++ b/frontend/assetic/yuicompressor.rst @@ -8,7 +8,7 @@ How to Minify JavaScripts and Stylesheets with YUI Compressor The YUI Compressor is `no longer maintained by Yahoo`_. That's why you are **strongly advised to avoid using YUI utilities** unless strictly necessary. - Read :doc:`/assetic/uglifyjs` for a modern and up-to-date alternative. + Read :doc:`/frontend/assetic/uglifyjs` for a modern and up-to-date alternative. Yahoo! provides an excellent utility for minifying JavaScripts and stylesheets so they travel over the wire faster, the `YUI Compressor`_. Thanks to Assetic, diff --git a/index.rst b/index.rst index eed3f3f5200..925f1a3296d 100644 --- a/index.rst +++ b/index.rst @@ -37,7 +37,6 @@ Topics .. toctree:: :maxdepth: 1 - assetic bundles console doctrine @@ -45,7 +44,6 @@ Topics deployment email event_dispatcher - expressions forms frontend http_cache diff --git a/quick_tour/the_view.rst b/quick_tour/the_view.rst index 91de1cfd620..693433805f7 100644 --- a/quick_tour/the_view.rst +++ b/quick_tour/the_view.rst @@ -262,7 +262,7 @@ Symfony provides the ``asset()`` function to deal with them easily: The ``asset()`` function looks for the web assets inside the ``web/`` directory. If you store them in another directory, read -:doc:`this article ` +:doc:`this article ` to learn how to manage web assets. Using the ``asset()`` function, your application is more portable. The reason diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index f8f8e9d90e3..30803e9e5bd 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -180,7 +180,7 @@ trusted_proxies **type**: ``array`` Configures the IP addresses that should be trusted as proxies. For more -details, see :doc:`/request/load_balancer_reverse_proxy`. +details, see :doc:`/deployment/proxies`. .. versionadded:: 2.3 CIDR notation support was introduced in Symfony 2.3, so you can whitelist diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index ca0859fbf9d..580d3f94491 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -193,7 +193,7 @@ Finally, apply the filter: {% endjavascripts %} You can also apply your filter via the ``assetic.filters.my_filter.apply_to`` -config option as it's described here: :doc:`/assetic/apply_to_option`. +config option as it's described here: :doc:`/frontend/assetic/apply_to_option`. In order to do that, you must define your filter service in a separate xml config file and point to this file's path via the ``assetic.filters.my_filter.resource`` configuration key. diff --git a/reference/twig_reference.rst b/reference/twig_reference.rst index f3f9c076527..e2e3da905d8 100644 --- a/reference/twig_reference.rst +++ b/reference/twig_reference.rst @@ -781,7 +781,7 @@ Those bundles can have other Twig extensions: * **Assetic** adds the ``{% stylesheets %}``, ``{% javascripts %}`` and ``{% image %}`` tags. You can read more about them in - :doc:`the Assetic Documentation `. + :doc:`the Assetic Documentation `. .. _`Twig Reference`: http://twig.sensiolabs.org/documentation#reference .. _`Twig Extensions repository`: https://github.com/twigphp/Twig-extensions diff --git a/security.rst b/security.rst index d69bf3dcb16..19b67508701 100644 --- a/security.rst +++ b/security.rst @@ -988,7 +988,7 @@ You can also use expressions inside your templates: Delete -For more details on expressions and security, see :ref:`expressions-security`. +For more details on expressions and security, see :doc:`/security/expressions`. .. _security-secure-objects: diff --git a/templating.rst b/templating.rst index 9e6ff2295af..3bdbf6e961b 100644 --- a/templating.rst +++ b/templating.rst @@ -808,7 +808,7 @@ advantage of Symfony's template inheritance. and JavaScript assets in Symfony. Symfony also packages another library, called Assetic, which follows this philosophy but allows you to do much more interesting things with those assets. For more information on - using Assetic see :doc:`/assetic/asset_management`. + using Assetic see :doc:`/frontend/assetic/asset_management`. Start by adding two blocks to your base template that will hold your assets: one called ``stylesheets`` inside the ``head`` tag and another called ``javascripts`` From f4a6d4ee958fe2e538897d78509d41d48b1b3be1 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 22 Oct 2017 20:07:53 -0400 Subject: [PATCH 8/9] removing doc --- request.rst | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 request.rst diff --git a/request.rst b/request.rst deleted file mode 100644 index 4106654c85b..00000000000 --- a/request.rst +++ /dev/null @@ -1,8 +0,0 @@ -Request -======= - -.. toctree:: - :maxdepth: 1 - :glob: - - request/* From 0401e38c32ba1f481e9a1b67827ddc72bdb6d3c6 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Tue, 24 Oct 2017 09:07:36 -0400 Subject: [PATCH 9/9] build fix, and better example --- index.rst | 1 - reference/configuration/framework.rst | 45 +++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/index.rst b/index.rst index 925f1a3296d..806fddb31ae 100644 --- a/index.rst +++ b/index.rst @@ -50,7 +50,6 @@ Topics logging performance profiler - request routing security session diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 30803e9e5bd..e56903a55f9 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -662,10 +662,55 @@ to one or more mime types (e.g. ``text/html``), which will allow you to use the format & mime types to call :method:`Request::getFormat($mimeType) ` or :method:`Request::getMimeType($format) `. + In practice, this is important because Symfony uses it to automatically set the ``Content-Type`` header on the ``Response`` (if you don't explicitly set one). If you pass an array of mime types, the first will be used for the header. +To configure a ``jsonp`` format: + +.. configuration-block:: + + .. code-block:: yaml + + # app/config/config.yml + framework: + request: + formats: + jsonp: 'application/javascript' + + .. code-block:: xml + + + + + + + + + + application/javascript + + + + + + .. code-block:: php + + // app/config/config.php + $container->loadFromExtension('framework', array( + 'request' => array( + 'formats' => array( + 'jsonp' => 'application/javascript', + ), + ), + )); router ~~~~~~