define_atBegin

Registers code to run at the beginning of response processing.

Target function

Signature

1define_atBegin(code)

Registers code to run at the beginning of response processing.

define_atBegin is a global callable that can be used wherever an expression is valid. define_atBegin belongs at the request or response boundary. Treat visitor input as untrusted, validate before use, and encode values before writing them into HTML.

Parameters

code
Required value. Supply code positionally unless the signature shows a keyword form.

Examples

Basic call

1define_atBegin({ log_detail('start') })
The example belongs near a request or response boundary; validate visitor input before trusting it.