User Tools

Site Tools


controller

Controllers

Controllers are managed by the haxe.web.Dispatch standard class.

Basic usage

//typed routes :   http://localhost/hello/Joe
function doHello( name:String ){
	view.text = “Hello ”+name;
}
 
//typed routes with record-macros objects : http://localhost/hello/1
function doHello( user:db.User){
	view.text = “Hello ”+user.name;
}

Learn more about how to use the Dispatch class

You can use the @tpl meta to define wich template to use for this action.

// http://localhost/user/edit/1
@tpl("user/edit.mtt")
function doEdit( user:db.User){
    //do something..
}