Getting Started
Your First Prompt
ExtendPrompt and implement body(). That’s it.
Creating Instances
There are two static constructors:Passing Context
Context is passed as named arguments. Pre-bound context fromwith() merges with context passed to render(), with render-time values taking precedence:
Stringable
Every prompt implementsStringable, so you can use it anywhere PHP accepts a string:
Returning Null
Abody() that returns null renders as an empty string. This is intentional — it enables conditional composition, which is covered in Composition.
Next Steps
- Composition — combine prompts into larger structures
- Templates — use Twig files for complex prompt content