What problem does it solve?
Provides a safe, centralized way to extend or override ColdBox framework objects so you can add application-level behavior without modifying framework source code, reducing duplication and enabling consistent request and controller handling across the app.
Core Features & Use Cases
- Controller Decorator: Override or extend controller-level behavior such as relocate/setNextEvent to enforce SSL, append tracking parameters, or provide global helper methods.
- Request Context Decorator: Add request-scoped helpers and transformations like auto-trimming inputs, requireValue validation helpers, getCurrentUser accessors, or API detection logic.
- Use Case: Implement a RequestContextDecorator that auto-trims incoming values and exposes getCurrentUser while a ControllerDecorator enforces SSL redirects and exposes app-level metadata.
Quick Start
Create and register a RequestContextDecorator that trims input values and adds a getCurrentUser helper, then wire a ControllerDecorator to enforce SSL on all relocations.