← ClaudeAtlas

create-admin-routinglisted

Create the Symfony routing YAML file declaring all admin routes for the domain. Trigger: "create routing for {Domain}".
jeffsenso/prestashop-skills · ★ 4 · AI & Automation · score 76
Install: claude install-skill jeffsenso/prestashop-skills
# create-admin-routing ## Instructions 1. Create `src/PrestaShopBundle/Resources/config/routing/admin/{domain}.yml`. 2. For each action in the controller (listing + form actions), declare a route. Always include `_legacy_controller` (permanent — see below). **While the page is under migration**, also include `_legacy_feature_flag` so requests are dispatched to the new or legacy controller depending on the flag state: ```yaml admin_{domain}s_index: path: /{domain}s methods: [GET] defaults: _controller: 'PrestaShopBundle:Admin/{Section}/{Domain}:index' _legacy_controller: Admin{Domain}s _legacy_feature_flag: {domain} ``` 3. Include routes: index (GET), create (GET+POST), edit (GET+POST with `{id}` parameter), delete (POST with `{id}`), toggle status (POST+JSON), bulk delete/enable/disable (POST). 4. Import this file from the main admin routing file. 5. CRITICAL: `_legacy_feature_flag` value must exactly match the `name` of the feature flag in feature_flag.xml. 6. Verify with `php bin/console debug:router | grep {domain}`. ### `_legacy_controller` is permanent Keep `_legacy_controller` on every route — it stays for the lifetime of the page, even after full migration. Two consumers depend on it: - **Permission checks:** admin permission rules are keyed by the legacy controller name. Action security expressions like `is_granted('read', request.get('_legacy_controller'))` rely on this attribute being present - **Automatic legacy lin