Skip to main content

ui:uid

Generates a unique identifier using bin2hex(random_bytes(4)).

This is used internally for the default value for the rootId prop in components. Its exposed as a ViewHelper for convenience.

Example

<f:variable name="myId">{ui:uid()}</f:variable>

this will generate a unique id like «42f10a7d»

Arguments

Name Type Description Required Default
prefix string The prefix of the generated ID No ''