Components
// ./wires/Counter.bx
class extends="cbwire.models.Component" {
// Data properties
data = {
"counter": 0 // default value
};
// Action
function increment() {
data.counter++;
}
// Helper method also available to template
function isEven() {
return data.counter % 2 == 0;
}
}// ./wires/Counter.cfc
component extends="cbwire.models.Component" {
// Data properties
data = {
"counter": 0 // default value
};
// Action
function increment() {
data.counter++;
}
// Helper method also available to template
function isEven() {
return data.counter % 2 == 0;
}
}Rendering Components
External Components
Passing Parameters
Using Parameters
Auto Populating Data Properties
Nesting Components
CBWIREController
Last updated
Was this helpful?