← ClaudeAtlas

coldbox-view-renderinglisted

Use this skill when rendering views and partials in ColdBox, creating reusable view components, caching view output, passing data to views, rendering views from services, using renderView() inline, or dynamically selecting views based on context.
ColdBox/skills · ★ 0 · AI & Automation · score 61
Install: claude install-skill ColdBox/skills
# View Rendering ## When to Use This Skill Use this skill when creating ColdBox views, rendering partials, passing data between handlers and views, and implementing view caching strategies. ## 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 ColdBox views: - Live in `views/` directory and match handler naming conventions - Receive data from handlers via `prc` (private request collection) - Are wrapped in layouts unless `noLayout()` is called - Can render partials with `renderView()` or `#renderView()#` - Can be cached per template or per event - Can render module-specific views ## Basic View Structure ```cfml <!--- views/users/index.cfm ---> <cfoutput> <div class="container"> <h1>Users</h1> <cfif flash.exists( "success" )> <div class="alert alert-success">