Controllers (Lava.Controller)
A Controller is similar to a Lava Object. One difference is that a controller is meant to be singular. You cannot clone a controller. Controllers in Lava are used to add behavior to the web application. They serve as the glue between the model (Lava.Object) and the view (the DOM). Creating a Controller is identical to creating an Object.
var PersonController = Lava.Controller({
getPeople: function () {
...
},
addPerson: function (e, args) {
...
},
deletePerson: function (e, args) {
...
}
});
Extending a Controller is identical to extending an Object.
PersonController.extend({
getCount: function () {
...
}
});