← ClaudeAtlas

coldbox-request-contextlisted

Use this skill when working with the ColdBox RequestContext object (event), managing rc and prc collections, building URLs with buildLink(), detecting HTTP methods, accessing request metadata, working with flash scope, handling AJAX requests, or reading HTTP headers and body content.
ColdBox/skills · ★ 0 · AI & Automation · score 61
Install: claude install-skill ColdBox/skills
# ColdBox Request Context ## When to Use This Skill Use this skill when working with the ColdBox `RequestContext` event object in handlers to manage request data, view rendering, HTTP info, and flash messaging. ## 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 The `RequestContext` (event object) is: - The central object for every ColdBox request - Injects into every handler action as `event` - Contains `rc` (public request collection) and `prc` (private collection) - Has methods for view rendering, relocation, headers, and HTTP introspection ## Request Collection Access ```boxlang function handler( event, rc, prc ) { // ----- Reading rc (public request collection) ----- var id = rc.id ?: 0 var search = rc.search ?: "" var page = rc.page ?: 1 // G