Skip to content

[Routing] Adding full example for a Service in Route Condition #17212

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 1 commit into from
Oct 26, 2022

Conversation

ThomasLandauer
Copy link
Contributor

Reasons:

  • There needs to be an example on how to pass any information to this callback service. I merely guessed the route syntax - it's not even explained at https://symfony.com/blog/new-in-symfony-6-1-services-in-route-conditions - is there a better way to do it?
  • How to call a method from this service wasn't explained (the .check() part)
  • This method needs to return bool?

I don't think it's a good idea to add those code blocks inside this indented "list" - will it even work? So probably it's better to create a dedicated paragraph (or even heading) for Services in Route Conditions. But you need to tell me how (i.e. what structure you have in mind).

@carsonbot carsonbot changed the title Adding full example for a Service in Route Condition [Routing] Adding full example for a Service in Route Condition Oct 18, 2022
@javiereguiluz javiereguiluz added this to the 6.1 milestone Oct 18, 2022
@javiereguiluz
Copy link
Member

Thanks Thomas!

While merging, I changed the order of the two PHP code samples to show the service first and the route condition second. See 8c3cb80

@ThomasLandauer ThomasLandauer deleted the patch-29 branch October 26, 2022 10:06
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.

4 participants