Skip to content
Open
Changes from all commits
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
Diff view
10 changes: 10 additions & 0 deletions Resources/doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ instead of ``web``, to achieve this you can set the ``target`` parameter:
# Symfony Flex
bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json

When you dump the routes from a command, the Request Context (e.g. host and base_url) are not known. To generate correct routes for each environment with console commands, add the following (see `How to Generate URLs from the Console`):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to Generate URLs from the Console should be a link to the proper page of the Symfony doc.


.. code-block:: yaml

# app/config/config_dev.yml (Symfony 3)
parameters:
router.request_context.host: "yourhost"
router.request_context.scheme: "http"
router.request_context.base_url: "/app_dev.php"

Then within your JavaScript development you can use:

.. code-block:: javascript
Expand Down