struct UI::RenderContext

Overview

Phase 8A — Renderer-scoped per-request context threaded through UI::Web::Renderer#render(view, render_context:). Carries values the web visit methods need but that don't belong on the view tree itself (e.g. the CSRF token for UI::Form's hidden-input injection).

Lives in the core UI namespace (rather than the Amber integration file) so the web renderer can read it without requiring the Amber integration to be loaded. Apps not using Amber simply pass a fresh RenderContext.empty or omit the argument.

Defined in:

ui/view.cr

Constructors

Instance Method Summary

Constructor Detail

def self.empty : RenderContext #

[View source]
def self.new(csrf_token : String | Nil = nil) #

[View source]

Instance Method Detail

def csrf_token : String | Nil #

[View source]