Packagecom.cmiscm.mvc
Classpublic class Controller
InheritanceController Inheritance Object

MVC Command - Singleton Pattern.

View the examples

See also

IController


Public Properties
 PropertyDefined By
  getInstance : Controller
[static] [read-only]
Controller
Public Methods
 MethodDefined By
  
Controller
  
addCommand($name:String, $command:IController):void
Add Command
Controller
  
getCommand($name:String):IController
Get Command return null in case not find Command
Controller
  
removeCommand($name:String):void
Remove Command
Controller
Property Detail
getInstanceproperty
getInstance:Controller  [read-only]


Implementation
    public static function get getInstance():Controller
Constructor Detail
Controller()Constructor
public function Controller()



Method Detail
addCommand()method
public function addCommand($name:String, $command:IController):void

Add Command

Parameters

$name:String — Command Name
 
$command:IController — Command implements IController

getCommand()method 
public function getCommand($name:String):IController

Get Command

return null in case not find Command

Parameters

$name:String — Command Name

Returns
IController
removeCommand()method 
public function removeCommand($name:String):void

Remove Command

Parameters

$name:String — Command Name

Examples
     // Add Command
     Controller.getInstance.addCommand(MenuCommand.NAME, new MenuCommand());
     
     // Get Command
     var menu:MenuCommand = Controller.getInstance.getCommand(MenuCommand.NAME) as MenuCommand;
     
     // Remove Command
     Controller.getInstance.removeCommand(MenuCommand.NAME);