8000 [FrameworkBundle] add documentation request context in Asset for use … by Warxcell · Pull Request #8653 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] add documentation request context in Asset for use … #8653

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Split Diff View
Split
Diff view
Prev Previous commit
Some rewording
  • Loading branch information
javiereguiluz authored May 22, 2018
commit e8d16d1279d2acf2fd16047c00369b936cc75a75
10 changes: 8 additions & 2 deletions console/request_context.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Configuring the Request Context Globally

To configure the Request Context - which is used by the URL Generator - you can
redefine the parameters it uses as default values to change the default host
(localhost) and scheme (http). You can also configure the base path if Symfony
is not running in the root directory.
(localhost) and scheme (http). You can also configure the base path (both for
the URL generator and the assets) if Symfony is not running in the root directory.

Note that this does not impact URLs generated via normal web requests, since those
will override the defaults.
Expand All @@ -37,6 +37,7 @@ will override the defaults.
router.request_context.scheme: https
router.request_context.base_url: my/path
asset.request_context.base_path: %router.request_context.base_url%
asset.request_context.secure: true

.. code-block:: xml

Expand All @@ -50,6 +51,7 @@ will override the defaults.
<parameter key="router.request_context.scheme">https</parameter>
<parameter key="router.request_context.base_url">my/path</parameter>
<parameter key="asset.request_context.base_path">%router.request_context.base_url%</parameter>
<parameter key="asset.request_context.secure">true</parameter>
</parameters>

</container>
Expand All @@ -61,6 +63,10 @@ will override the defaults.
$container->setParameter('router.request_context.scheme', 'https');
$container->setParameter('router.request_context.base_url', 'my/path');
$container->setParameter('asset.request_context.base_path', $container->getParameter('router.request_context.base_url'));
$container->setParameter('asset.request_context.secure', true);

.. versionadded:: 3.4
The ``asset.request_context.*`` parameters were introduced in Symfony 3.4.

Configuring the Request Context per Command
-------------------------------------------
Expand Down
0