PureMVC Framework for haXe: API Documentation
Back | Index
class org.puremvc.haxe.core.Controller
implements org.puremvc.haxe.interfaces.IController

A Singleton IController implementation.

In PureMVC, the Controller class follows the 'Command and Controller' strategy, and assumes these responsibilities:

Your application must register ICommands with the Controller. The simplest way is to subclass Facade, and use its initializeController method to add your registrations.

function executeCommand(note : org.puremvc.haxe.interfaces.INotification) : Void
If an ICommand has previously been registered to handle a the given INotification, then it is executed.
function hasCommand(notificationName : String) : Bool
Check if a Command is registered for a given Notification
function registerCommand(notificationName : String, commandClassRef : Class<org.puremvc.haxe.interfaces.ICommand>) : Void

Register a particular ICommand class as the handler for a particular INotification.

If an ICommand has already been registered to handle INotifications with this name, it is no longer used, the new ICommand is used instead.

The Observer for the new ICommand is only created if this the first time an ICommand has been regisered for this Notification name.

function removeCommand(notificationName : String) : Void
Remove a previously registered ICommand to INotification mapping.
static function getInstance() : org.puremvc.haxe.interfaces.IController
Controller Singleton Factory method.
Back | Index