-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[Cookbook][Routing] Update custom_route_loader.rst #4790
Conversation
I agree with you, I see no benefit of a custom routing loader. Some changes in this PR might conflict with #4740. Could you please check that and remove the ones that will conflict? |
Indeed, my bad. I thought it changed all cookbook articles. |
|
||
.. note:: | ||
|
||
There are many bundles out there that use their own route loaders to | ||
accomplish cases like those described above, for instance | ||
`FOSRestBundle`_, `JMSI18nRoutingBundle`_, `KnpRadBundle`_ and `SonataAdminBundle`_. | ||
`FOSRestBundle`_, `JMSI18nRoutingBundle`_, `KnpRadBundle`_ and | ||
`SonataAdminBundle`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to add AsseticBundle in the list actually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather see a shorter list than making it longer
@xelaris this looks great - nice work! But you're right - the first 2 paragraphs (especially the first) is terrible! I think we should mention FOSRestBundle as we do now, and make a new intro centered around it as one example. Also, it's out of scope, but I think we should just show the class extending @xelaris Can you at least take a shot at updating the first paragraph for us? |
ping @xelaris :) |
Thank you for the ping @xabbuh. I will try to go on with this on the weekend. |
6452b3f
to
9ec72b1
Compare
@weaverryan Thank you for the feedback. I have changed the first two paragraphs and tried to make it more clear. |
ping @weaverryan |
have to create an ``extraAction`` method in the ``ExtraController`` | ||
of the ``AppBundle``:: | ||
|
||
namespace AppBundle\Controller; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should add the filename comment above this:
// src/AppBundle/Controller/ExtraController.php
9ec72b1
to
08b1527
Compare
Thanks @xabbuh. I have added filename comments to all the php code blocks. |
I don't think anything is missing here. Flagged it with Finished :) |
I agree 👍 |
This looks really awesome - I have no changes. Thanks so much Alexander! |
…aris) This PR was merged into the 2.3 branch. Discussion ---------- [Cookbook][Routing] Update custom_route_loader.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | Just some tweaks (including "Acme\DemoBundle" => "AppBundle"). While reading this chapter I wonder, if > A custom route loader allows you to add routes to an application without including them, for example, in a YAML file. [...] This may be especially important when you want to make the bundle reusable, or when you have open-sourced it as this would slow down the installation process and make it error-prone. may raise false expectations. Since also with a route loader it is still required to add something to the routing.yml (or xml). I don't see the benefit of using a custom route loader in a reusable bundle over importing a YAML file from a third-party bundle like FOSUserBundle. It makes totally sense for something like the FOSRestBundle does (generating routes based on conventions), but the chapter introduction sounds, like a Bundle could load its routes without manual tweaks to the config. If I am not wrong, this isn't possible, isn't it? Commits ------- 08b1527 Add filename comments to code blocks fe1a574 Change code example to extend from Loader class bd6e3f3 Rewrite first paragraph 46d10a2 [Cookbook][Routing] Update custom_route_loader.rst
Just some tweaks (including "Acme\DemoBundle" => "AppBundle").
While reading this chapter I wonder, if
may raise false expectations. Since also with a route loader it is still required to add something to the routing.yml (or xml). I don't see the benefit of using a custom route loader in a reusable bundle over importing a YAML file from a third-party bundle like FOSUserBundle. It makes totally sense for something like the FOSRestBundle does (generating routes based on conventions), but the chapter introduction sounds, like a Bundle could load its routes without manual tweaks to the config. If I am not wrong, this isn't possible, isn't it?