Data Binding

You can bind your data properties to input elements within your template using wire:model.

// wires/MyComponent.bx
class extends="cbwire.models.Component" {
    
    // Data properties
    data = {
        "name": ""
    };
}
<!--- ./wires/MyComponent.bxm|cfm --->
<div>
    <form>
        <input wire:model.live="name" type="text">
        Name updated at #now()#
    </form>
</div>

Resources

When data properties are updated using wire:model, CBWIRE has several methods you can hook into such as onUpdate and onHyrdate ( See Lifecycle Methods ).

Last updated

Was this helpful?