[Feature] Support setting URL fragment with AdminUrlGenerator

Open
#7,218 1 comment 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@beknownst is already working on this.

Since Nov 6, 2025.

  • #7219 by @beknownst — open

Assessment

Difficulty
2/5
Estimated time
Half a day
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
php, symfony
Domain
backend

Research direction

Start with the AdminUrlGenerator class and inspect existing dedicated setters such as setEntityId() and setController(), then review Symfony's native URL-fragment support through the _fragment parameter. Done means setFragment('tab-inventory') can generate a URL ending in #tab-inventory while preserving the existing generator behavior.

Written by the indexing model from the issue text.

Description

feature stale

Short description of what this feature will allow to do:
Add support for URL fragments (hash anchors) to the AdminUrlGenerator class, enabling developers to generate admin URLs that scroll to specific sections of a page or reference/activate a specific tab (e.g. #tab-main). This could be realised by using Symfony's native router support for URL fragments via the _fragment parameter.

I am aware that it currently is possible to use $this->adminUrlGenerator->set('_fragment', 'tab-main') in order to achieve the requested behaviour, but I find it not very clean and consistent with the other dedicated functions EasyAdmin has (e.g., setEntityId() instead of set('entityId', ...) and setController() instead of set('crudControllerFqcn', ...)).

This enhancement makes it easier for developers to link directly to specific page sections (tabs, accordions, anchors) in their admin interfaces and to reference the fragment functionality in documentation.
_

Example of how to use this feature


$url = $this->adminUrlGenerator
    ->setController(SomeCrudController::class)
    ->setAction(Action::EDIT)
    ->setEntityId(123)
    ->setFragment('tab-inventory')
    ->generateUrl();

// Result: /admin/some/edit/123#tab-inventory

Dominant language
PHP
Stars
4.3k
Forks
1.1k
Avg merge
2d 9h
Merged PRs (30d)
52

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EasyCorp/EasyAdminBundle

All issues in EasyCorp/EasyAdminBundle

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.