Skip to content

[Routing] Update routing.rst, add example routes as annotations #10201

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
Aug 12, 2019
Merged

[Routing] Update routing.rst, add example routes as annotations #10201

merged 2 commits into from
Aug 12, 2019

Conversation

andreybolonin
Copy link
Contributor

No description provided.

@andreybolonin andreybolonin changed the title Update routing.rst, add example routes as annotations [Routing] Update routing.rst, add example routes as annotations Aug 20, 2018
@weaverryan
Copy link
Member

Hey @andreybolonin!

Thanks for the PR to add more details :). I just updated a few parts of the code to use use statements, for example. But, there is one problem left: the code uses a class from FrameworkBundle - AnnotatedRouteControllerLoader. But, we can't do that: because this code is about setting up the Routing component in a standalone project, we can only use classes from other components.

Could you update the code to not use this class? It's actually a bit odd, I see why you used AnnotatedRouteControllerLoader... it does some nice things with setting the _controller. I'm not actually sure if there is a feasible way of not using this class. That's what we need to check out.

Status: Needs work

@javiereguiluz
Copy link
Member

@weaverryan I think it's really difficult to not use AnnotatedRouteControllerLoader in this example ... unless we copy+paste the code from AnnotatedRouteControllerLoader ... is it worth it?

@javiereguiluz
Copy link
Member

Another solution would be to not use AnnotatedRouteControllerLoader ... but then, which format should use the PHP classes to define annotations on them? What's the difference when not using AnnotatedRouteControllerLoader? This is the component doc, so I guess is OK to not provide all features included in the full Symfony framework.

@xabbuh xabbuh added this to the 3.4 milestone Mar 8, 2019
@xabbuh xabbuh added the Routing label Mar 8, 2019
@javiereguiluz javiereguiluz modified the milestones: 3.4, 4.3 Aug 12, 2019
@javiereguiluz javiereguiluz changed the base branch from 4.1 to 4.3 August 12, 2019 11:29
@javiereguiluz
Copy link
Member

Andrey, we're sorry for not having merged this until today. We finally did. We decided to keep the example with the AnnotatedRouteControllerLoader because the docs about Symfony components are read by advanced developers and they'll know what to do (install the dependency or copy code from it). Thanks!

@javiereguiluz javiereguiluz merged commit 54743d6 into symfony:4.3 Aug 12, 2019
javiereguiluz added a commit that referenced this pull request Aug 12, 2019
…tations (andreybolonin, weaverryan)

This PR was submitted for the 4.1 branch but it was merged into the 4.3 branch instead (closes #10201).

Discussion
----------

[Routing] Update routing.rst, add example routes as annotations

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/roadmap for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `master` for features of unreleased versions).

-->

Commits
-------

54743d6 cleaning up some use statements, etc
0a1badf Update routing.rst
@andreybolonin
Copy link
Contributor Author

@javiereguiluz thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants