Skip to content
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

Added hint how fosjsrouting works #785

Merged
merged 4 commits into from
Apr 26, 2024
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
Diff view
8 changes: 8 additions & 0 deletions book/extend-admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ as well, then you should be able to see these actions when using the ``debug:rou
app.put_event PUT ANY ANY /admin/api/events/{id}.{_format}
app.delete_event DELETE ANY ANY /admin/api/events/{id}.{_format}

.. note::

Routes to this actions must be exposed using `FOSJsRoutingBundle`_, and also they must have set ``methods``
parameter (e.g. ``options: ['expose' => true], methods: ['GET']``). Examples can be found at `Sulu Workshops`_, specificly in assignment 10.
Prokyonn marked this conversation as resolved.
Show resolved Hide resolved


These routes are spread over two different URLs, one without the ID (``/admin/api/events``) and one with the ID
(``/admin/api/events/{id}``). The first one is used to get a list of available events and to create new events, while
the latter is about already existing events.
Expand Down Expand Up @@ -889,3 +895,5 @@ the parent then the ``/config/forms/event_details.xml`` would look like this:
.. _Sulu workshop: https://github.com/sulu/sulu-workshop
.. _Sulu Demo repository: https://github.com/sulu/sulu-demo/pulls?q=is%3Aopen+is%3Apr+label%3AExample
.. _Sulu Javascript Docs: https://jsdocs.sulu.io/
.. _FOSJsRoutingBundle: https://github.com/FriendsOfSymfony/FOSJsRoutingBundle/blob/master/Resources/doc/usage.rst
.. _Sulu Workshops: https://github.com/sulu/sulu-workshop/pulls