Skip to content

Conversation

@xepozz
Copy link
Contributor

@xepozz xepozz commented Nov 26, 2020

Now class User processes the routing for posts action 😀

image

I've fixed ridiculoues example of routing classes 👍

image

<div class="php8-code phpcode">
<?php highlight_php_trimmed(
'/**
* @Route("/api/posts/{id}", methods={"GET", "HEAD"})
Copy link

Choose a reason for hiding this comment

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

a simpler fix would have been changing api/posts/{id} to api/users 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And changing User -> UsersController?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the same we need to present method's attribute when we using Route annotation.
Controller's action is most popular example instead of separated action's action.

Copy link

Choose a reason for hiding this comment

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

actually, it can be applied to both at the same time, and this is not a real application, it's only an example to show the new syntax, and is not referring to a specific library/framework.

https://github.com/azjezz/symfony-boilerplate/blob/f4661afc5790d3a7b42925fba1de23bfa9bb3d6b/src/Controller/User/DeleteController.php#L29-L56

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image
@azjezz WDYT about this ^?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made in separate PR #358

@cmb69
Copy link
Member

cmb69 commented Nov 26, 2020

Thank you!

@xepozz xepozz deleted the fix-typo branch November 28, 2020 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants