routing-controllers
Installation
SKILL.md
Drupal Routing and Controllers
When to use
- The user is writing a Drupal controller that returns a render array or a JSON/redirect response.
- The user wants to define a Drupal route in routing.yml that maps a path to a controller method.
- The user needs to restrict a Drupal route by permission, role, or a custom access check.
When NOT to use
- Do not hand-roll a controller route when JSON:API or the REST module already exposes the entity the client needs.
- Do not write a route and controller when editors only need a static content page that a node or Views can provide.