Skip to content

Commit a6f299e

Browse files
committed
minor #8537 Docs re-org and removal of small sections (weaverryan)
This PR was squashed before being merged into the 2.7 branch (closes #8537). Discussion ---------- Docs re-org and removal of small sections Hi guys! I'd like to have less "Guides" on the left. Some of them only have 1 article or (imo) are not something that's helpful for the user. In this PR, i: 1) Move Assetic out of the top-level and under `frontend`. 2) Removed/moved the Expressions guide 3) Removed/moved the "Request" guides On Symfony.com, we would need to remove the "Assetic", "Expressions" and "Request" guides. All of this content still exists, just somewhere else. The bigger goal is - through a number of PR's - to reduce the number of "guides" links and make sure we have the best links that people will be looking for. Thanks! Commits ------- 678a921 Docs re-org and removal of small sections
2 parents 0c6df00 + 678a921 commit a6f299e

25 files changed

+113
-178
lines changed

_build/redirection_map

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,20 @@
7676
/book/configuration /configuration
7777
/book/propel /propel/propel
7878
/book/performance /performance
79-
/cookbook/assetic/apply_to_option /assetic/apply_to_option
80-
/cookbook/assetic/asset_management /assetic/asset_management
81-
/cookbook/assetic/index /assetic
82-
/cookbook/assetic/jpeg_optimize /assetic/jpeg_optimize
83-
/cookbook/assetic/php /assetic/php
84-
/cookbook/assetic/uglifyjs /assetic/uglifyjs
85-
/cookbook/assetic/yuicompressor /assetic/yuicompressor
79+
/cookbook/assetic/apply_to_option /frontend/assetic/apply_to_option
80+
/cookbook/assetic/asset_management /frontend/assetic/asset_management
81+
/cookbook/assetic/index /frontend/assetic
82+
/cookbook/assetic/jpeg_optimize /frontend/assetic/jpeg_optimize
83+
/cookbook/assetic/php /frontend/assetic/php
84+
/cookbook/assetic/uglifyjs /frontend/assetic/uglifyjs
85+
/cookbook/assetic/yuicompressor /frontend/assetic/yuicompressor
86+
/assetic /frontend/assetic
87+
/assetic/apply_to_option /frontend/assetic/apply_to_option
88+
/assetic/asset_management /frontend/assetic/asset_management
89+
/assetic/jpeg_optimize /frontend/assetic/jpeg_optimize
90+
/assetic/php /frontend/assetic/php
91+
/assetic/uglifyjs /frontend/assetic/uglifyjs
92+
/assetic/yuicompressor /frontend/assetic/yuicompressor
8693
/cookbook/bundles/best_practices /bundles/best_practices
8794
/cookbook/bundles/configuration /bundles/configuration
8895
/cookbook/bundles/extension /bundles/extension
@@ -150,7 +157,8 @@
150157
/cookbook/event_dispatcher/event_listener /event_dispatcher
151158
/cookbook/event_dispatcher/index /event_dispatcher
152159
/cookbook/event_dispatcher/method_behavior /event_dispatcher/method_behavior
153-
/cookbook/expressions /expressions/expressions
160+
/cookbook/expressions /security/expressions
161+
/expressions /security/expressions
154162
/cookbook/form/create_custom_field_type /form/create_custom_field_type
155163
/cookbook/form/create_form_type_extension /form/create_form_type_extension
156164
/cookbook/form/data_transformers /form/data_transformers
@@ -181,10 +189,10 @@
181189
/cookbook/profiler/matchers /profiler/matchers
182190
/cookbook/profiler/profiling_data /profiler/profiling_data
183191
/cookbook/profiler/storage /profiler/storage
184-
/cookbook/psr7 /request/psr7
192+
/cookbook/psr7 /components/psr7
185193
/cookbook/request/index /request
186-
/cookbook/request/load_balancer_reverse_proxy /request/load_balancer_reverse_proxy
187-
/cookbook/request/mime_type /request/mime_type
194+
/cookbook/request/load_balancer_reverse_proxy /deployment/proxies
195+
/cookbook/request/mime_type /reference/configuration/framework#formats
188196
/cookbook/routing/conditions /routing/conditions
189197
/cookbook/routing/custom_route_loader /routing/custom_route_loader
190198
/cookbook/routing/debug /routing/debug
@@ -303,6 +311,7 @@
303311
/components/form/type_guesser /form/type_guesser
304312
/components/http_foundation/index /components/http_foundation
305313
/components/http_foundation/introduction /components/http_foundation
314+
/components/http_foundation/trusting_proxies /deployment/proxies
306315
/components/http_kernel/introduction /components/http_kernel
307316
/components/http_kernel/index /components/http_kernel
308317
/components/property_access/introduction /components/property_access
@@ -327,3 +336,4 @@
327336
/form /forms
328337
/testing/simulating_authentication /testing/http_authentication
329338
/validation/group_service_resolver /form/validation_group_service_resolver
339+
/request/load_balancer_reverse_proxy /deployment/proxies

best_practices/web-assets.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ tools like GruntJS.
4949
Use Assetic to compile, combine and minimize web assets, unless you're
5050
comfortable with frontend tools like GruntJS.
5151

52-
:doc:`Assetic </assetic/asset_management>` is an asset manager capable
52+
:doc:`Assetic </frontend/assetic/asset_management>` is an asset manager capable
5353
of compiling assets developed with a lot of different frontend technologies
5454
like LESS, Sass and CoffeeScript. Combining all your assets with Assetic is a
5555
matter of wrapping all the assets with a single Twig tag:
@@ -87,8 +87,8 @@ Learn More about Assetic
8787
------------------------
8888

8989
Assetic can also minimize CSS and JavaScript assets
90-
:doc:`using UglifyCSS/UglifyJS </assetic/uglifyjs>` to speed up your
91-
websites. You can even :doc:`compress images </assetic/jpeg_optimize>`
90+
:doc:`using UglifyCSS/UglifyJS </frontend/assetic/uglifyjs>` to speed up your
91+
websites. You can even :doc:`compress images </frontend/assetic/jpeg_optimize>`
9292
with Assetic to reduce their size before serving them to the user. Check out
9393
the `official Assetic documentation`_ to learn more about all the available
9494
features.

components/expression_language.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ Learn More
119119
:maxdepth: 1
120120
:glob:
121121

122-
/expressions
123122
/components/expression_language/*
124123
/service_container/expression_language
125124
/reference/constraints/Expression

components/http_foundation.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ Learn More
611611
/components/http_foundation/*
612612
/controller
613613
/controller/*
614-
/request/*
615614
/session/*
616615
/http_cache/*
617616

components/http_foundation/trusting_proxies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Trusting Proxies
77
.. tip::
88

99
If you're using the Symfony Framework, start by reading
10-
:doc:`/request/load_balancer_reverse_proxy`.
10+
:doc:`/deployment/proxies`.
1111

1212
If you find yourself behind some sort of proxy - like a load balancer - then
1313
certain header information may be sent to you using special ``X-Forwarded-*``

request/psr7.rst renamed to components/psr7.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Installation
1313

1414
You can install the component in 2 different ways:
1515

16-
* :doc:`Install it via Composer </components/using_components>` (`symfony/psr-http-message-bridge on Packagist <https://packagist.org/packages/symfony/psr-http-message-bridge>`_);
16+
* :doc:`Install it via Composer </components/using_components>` (`symfony/psr-http-message-bridge on Packagist`_);
1717
* Use the official Git repository (https://github.com/symfony/psr-http-message-bridge).
1818

1919
The bridge also needs a PSR-7 implementation to allow converting HttpFoundation
@@ -87,3 +87,4 @@ to a :class:`Symfony\\Component\\HttpFoundation\\Response` instance::
8787

8888
.. _`PSR-7`: http://www.php-fig.org/psr/psr-7/
8989
.. _`Zend Diactoros`: https://github.com/zendframework/zend-diactoros
90+
.. _`symfony/psr-http-message-bridge on Packagist`: https://packagist.org/packages/symfony/psr-http-message-bridge
File renamed without changes.

frontend.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@ Front-end
22
=========
33

44
See the latest version of the docs for frontend tools. Or, see
5-
:doc:`/assetic`.
5+
:doc:`/frontend/assetic`.
66

7+
.. toctree::
8+
:maxdepth: 1
9+
:glob:
10+
:hidden:
11+
12+
frontend/*
File renamed without changes.
File renamed without changes.

assetic/asset_management.rst renamed to frontend/assetic/asset_management.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ To include an image you can use the ``image`` tag.
181181
<?php endforeach ?>
182182

183183
You can also use Assetic for image optimization. More information in
184-
:doc:`/assetic/jpeg_optimize`.
184+
:doc:`/frontend/assetic/jpeg_optimize`.
185185

186186
.. tip::
187187

@@ -441,7 +441,7 @@ into your template:
441441
<?php endforeach ?>
442442
443443
A more detailed guide about configuring and using Assetic filters as well as
444-
details of Assetic's debug mode can be found in :doc:`/assetic/uglifyjs`.
444+
details of Assetic's debug mode can be found in :doc:`/frontend/assetic/uglifyjs`.
445445

446446
Controlling the URL Used
447447
------------------------
File renamed without changes.
File renamed without changes.
File renamed without changes.

assetic/yuicompressor.rst renamed to frontend/assetic/yuicompressor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ How to Minify JavaScripts and Stylesheets with YUI Compressor
88

99
The YUI Compressor is `no longer maintained by Yahoo`_. That's why you are
1010
**strongly advised to avoid using YUI utilities** unless strictly necessary.
11-
Read :doc:`/assetic/uglifyjs` for a modern and up-to-date alternative.
11+
Read :doc:`/frontend/assetic/uglifyjs` for a modern and up-to-date alternative.
1212

1313
Yahoo! provides an excellent utility for minifying JavaScripts and stylesheets
1414
so they travel over the wire faster, the `YUI Compressor`_. Thanks to Assetic,

index.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,19 @@ Topics
3737
.. toctree::
3838
:maxdepth: 1
3939

40-
assetic
4140
bundles
4241
console
4342
doctrine
4443
debug
4544
deployment
4645
email
4746
event_dispatcher
48-
expressions
4947
forms
5048
frontend
5149
http_cache
5250
logging
5351
performance
5452
profiler
55-
request
5653
routing
5754
security
5855
session

quick_tour/the_view.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ Symfony provides the ``asset()`` function to deal with them easily:
262262
263263
The ``asset()`` function looks for the web assets inside the ``web/`` directory.
264264
If you store them in another directory, read
265-
:doc:`this article </assetic/asset_management>`
265+
:doc:`this article </frontend/assetic/asset_management>`
266266
to learn how to manage web assets.
267267

268268
Using the ``asset()`` function, your application is more portable. The reason

reference/configuration/framework.rst

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Configuration
5050
* `ip`_
5151
* :ref:`path <reference-profiler-matcher-path>`
5252
* `service`_
53+
* `request`_:
54+
* `formats`_
5355
* `router`_
5456
* `resource`_
5557
* `type`_
@@ -178,7 +180,7 @@ trusted_proxies
178180
**type**: ``array``
179181

180182
Configures the IP addresses that should be trusted as proxies. For more
181-
details, see :doc:`/request/load_balancer_reverse_proxy`.
183+
details, see :doc:`/deployment/proxies`.
182184

183185
.. versionadded:: 2.3
184186
CIDR notation support was introduced in Symfony 2.3, so you can whitelist
@@ -647,6 +649,69 @@ service
647649

648650
This setting contains the service id of a custom matcher.
649651

652+
request
653+
~~~~~~~
654+
655+
formats
656+
.......
657+
658+
**type**: ``array`` **default**: ``[]``
659+
660+
This setting is used to associate additional request formats (e.g. ``html``)
661+
to one or more mime types (e.g. ``text/html``), which will allow you to use the
662+
format & mime types to call
663+
:method:`Request::getFormat($mimeType) <Symfony\\Component\\HttpFoundation\\Request::getFormat>` or
664+
:method:`Request::getMimeType($format) <Symfony\\Component\\HttpFoundation\\Request::getMimeType>`.
665+
666+
In practice, this is important because Symfony uses it to automatically set the
667+
``Content-Type`` header on the ``Response`` (if you don't explicitly set one).
668+
If you pass an array of mime types, the first will be used for the header.
669+
670+
To configure a ``jsonp`` format:
671+
672+
.. configuration-block::
673+
674+
.. code-block:: yaml
675+
676+
# app/config/config.yml
677+
framework:
678+
request:
679+
formats:
680+
jsonp: 'application/javascript'
681+
682+
.. code-block:: xml
683+
684+
<!-- app/config/config.xml -->
685+
<?xml version="1.0" encoding="UTF-8" ?>
686+
687+
<container xmlns="http://symfony.com/schema/dic/services"
688+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
689+
xmlns:framework="http://symfony.com/schema/dic/symfony"
690+
xsi:schemaLocation="http://symfony.com/schema/dic/services
691+
http://symfony.com/schema/dic/services/services-1.0.xsd
692+
http://symfony.com/schema/dic/symfony
693+
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
694+
695+
<framework:config>
696+
<framework:request>
697+
<framework:format name="jsonp">
698+
<framework:mime-type>application/javascript</framework:mime-type>
699+
</framework:format>
700+
</framework:request>
701+
</framework:config>
702+
</container>
703+
704+
.. code-block:: php
705+
706+
// app/config/config.php
707+
$container->loadFromExtension('framework', array(
708+
'request' => array(
709+
'formats' => array(
710+
'jsonp' => 'application/javascript',
711+
),
712+
),
713+
));
714+
650715
router
651716
~~~~~~
652717

reference/dic_tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Finally, apply the filter:
193193
{% endjavascripts %}
194194
195195
You can also apply your filter via the ``assetic.filters.my_filter.apply_to``
196-
config option as it's described here: :doc:`/assetic/apply_to_option`.
196+
config option as it's described here: :doc:`/frontend/assetic/apply_to_option`.
197197
In order to do that, you must define your filter service in a separate xml
198198
config file and point to this file's path via the ``assetic.filters.my_filter.resource``
199199
configuration key.

reference/twig_reference.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ Those bundles can have other Twig extensions:
781781

782782
* **Assetic** adds the ``{% stylesheets %}``, ``{% javascripts %}`` and
783783
``{% image %}`` tags. You can read more about them in
784-
:doc:`the Assetic Documentation </assetic/asset_management>`.
784+
:doc:`the Assetic Documentation </frontend/assetic/asset_management>`.
785785

786786
.. _`Twig Reference`: http://twig.sensiolabs.org/documentation#reference
787787
.. _`Twig Extensions repository`: https://github.com/twigphp/Twig-extensions

request.rst

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)