trigger_event

Trigger a named {% wire %} event in the browser. The required name argument identifies the wire; every other action argument is passed to the named event.

{% wire name="refresh-preview" action={update target="preview" template="_preview.tpl"} %}
{% button text="Refresh" action={trigger_event name="refresh-preview" id=id} %}

In this example the named wire receives id as an event argument when the button is clicked.

Edit on GitHub

Referred by

Category

Actions

Browser actions that templates attach to events with Zotonic's wiring system.