Create controller listing

From PrestaShop/PrestaShop · View interactive version

Create controller listing is an AI agent skill from the GitHub repository PrestaShop/PrestaShop. Create the listing page actions in the admin controller: index (grid with filters), delete, toggle status, and any bulk actions the entity requires. Trigger: "create listing for {Domain}", "create index action for {Domain}".

How to use this skill

Skill file

create-controller-listing

Read @.ai/Component/Controller/CONTEXT.md for controller conventions (base class, DI, security attributes, error mapping).

Read @.ai/Component/Grid/CONTEXT.md for grid patterns (definition factory, query builder, filters).

1. Index action

#[AdminSecurity("is_granted('read', request.get('_legacy_controller'))")]
public function indexAction({Domain}Filters $filters): Response

Reference: TaxController::indexAction(), ManufacturerController::indexAction()

2. Search and reset

3. Delete action

#[AdminSecurity("is_granted('delete', request.get('_legacy_controller'))")]
public function deleteAction(int ${domain}Id): RedirectResponse

4. Toggle status action

#[AdminSecurity("is_granted('update', request.get('_legacy_controller'))")]
public function toggleStatusAction(int ${domain}Id): JsonResponse

5. Bulk actions

Create one method per bulk action the grid defines — not all entities have the same set:

#[AdminSecurity("is_granted('delete', request.get('_legacy_controller'))")]
public function bulkDeleteAction(Request $request): RedirectResponse

Common pattern for all bulk actions:

Rules

See Controller/CONTEXT.md for all conventions (Filters argument, bulk exception handling, toggle JSON). Skill-specific reminder:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.