← ClaudeAtlas

coldbox-handler-developmentlisted

Use this skill when creating ColdBox handlers (controllers), implementing CRUD actions, adding dependency injection to handlers, working with preHandler/postHandler advices, secured actions, REST handlers, or the EventHandler base class.
ColdBox/skills · ★ 0 · AI & Automation · score 61
Install: claude install-skill ColdBox/skills
# Handler Development ## When to Use This Skill Use this skill when creating ColdBox handlers (controllers) for handling HTTP requests, implementing CRUD operations, or building web interfaces. ## Language Mode Reference Examples use **BoxLang (`.bx`)** syntax by default. Adapt for your target language: | Concept | BoxLang (`.bx`) | CFML (`.cfc`) | |---------|-----------------|---------------| | Class declaration | `class [extends="..."] {` | `component [extends="..."] {` | | DI annotation | `@inject` above `property name="svc";` | `property name="svc" inject="svc";` | | View templates | `.bxm` suffix | `.cfm` / `.cfml` suffix | | Tag prefix | `<bx:if>`, `<bx:output>`, `<bx:set>` | `<cfif>`, `<cfoutput>`, `<cfset>` | > **CFML Compat Mode**: With BoxLang + CFML Compat module, `.bx` and `.cfc` files coexist freely. BoxLang-native classes use `class {}` (`.bx` files); CFML-compat classes use `component {}` (`.cfc` files). ## Core Concepts Handlers are ColdBox's controllers that: - Handle HTTP requests and orchestrate application flow - Receive the event object, request collection (rc), and private request collection (prc) - Use dependency injection for services and models - Return views or data responses - Can be secured with security annotations ## Implementation Steps 1. Define handler name and actions 2. Add dependency injection for required services 3. Implement actions with event, rc, prc parameters 4. Process request data and delegate to services 5. Populate prc