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

Add support for pretty URLs #6467

Open
wants to merge 35 commits into
base: 4.x
Choose a base branch
from

Conversation

javiereguiluz
Copy link
Collaborator

A quick example is worth a thousand words:

// Before
https://example.com/admin?crudAction=edit&crudControllerFqcn=App%5CController%5CAdmin%5CPostCrudController&entityId=3874

// After
https://example.com/admin/post/3874/edit
  • Read the updated docs in the PR to learn more about this feature.
  • This PR still needs some minor changes (e.g. I'll add an interface for the new AdminRouteGenerator class, etc.) but it's ready for test it.

@javiereguiluz javiereguiluz added this to the 4.x milestone Oct 10, 2024
@javiereguiluz
Copy link
Collaborator Author

Update: we generated all routes for all controllers + actions on all dashboards. If you have just one dashboard, that's fine.

But, if you have many, it's common that you only let certain controllers in some of those dashboards (think of a "guest dashboard" or "external collaborator" dashboard that only includes a few links in the menu to manage a subset of all your crud controllers).

Although this is not a security issue because you can restrict actions in many ways .... I think it's better to not generate the routes for the controllers that cannot be accessed on some dashboards. So, we just added a feature to configure that. See the previous commit and the docs included in it.

@Seb33300
Copy link
Contributor

Seb33300 commented Oct 13, 2024

I have few questions:

  • in the same way we can define the title of a Crud, is there any chance we could define the slug/path too?
  • we can have multiple crud for the same entity, did you handle that case? (previous question may be a way to handle it)
    Just checked the code and the path is based on the crud class name, not on the entity so it's fine!

Comment on lines +16 to +18
public function __construct()
{
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove useless construct?

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

Successfully merging this pull request may close these issues.

2 participants