org.puremvc.php.core
[ class tree: org.puremvc.php.core ] [ index: org.puremvc.php.core ] [ all elements ]

Class: Controller

Source Location: /core/Controller.php

Class Overview


A Singleton
implementation.


Author(s):

Implements interfaces:

Variables

Methods



Class Details

[line 54]
A Singleton
implementation.

In PureMVC, the

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

Your application must register

  1. ICommands
with the Controller.

The simplest way is to subclass </code>Facade</code>, and use its

method to add your registrations.




Tags:

see:  org.puremvc.php.patterns.command.MacroCommand MacroCommand
see:  org.puremvc.php.patterns.command.SimpleCommand SimpleCommand
see:  org.puremvc.php.patterns.observer.Notification Notification
see:  org.puremvc.php.patterns.observer.Observer Observer
see:  org.puremvc.core.View View


[ Top ]


Class Variables

static $instance =

[line 64]



Tags:

access:  protected

Type:   mixed


[ Top ]

$commandMap =

[line 61]



Tags:

access:  protected

Type:   mixed


[ Top ]

$view =

[line 58]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method getInstance [line 114]

static the getInstance( )

Singleton Factory method.



Tags:

return:  Singleton instance of
access:  public


[ Top ]

method executeCommand [line 126]

void executeCommand( $note)

If an
has previously been registered to handle a the given
, then it is executed.



Tags:

access:  public


Parameters:

note   $note   an

[ Top ]

method hasCommand [line 155]

whether hasCommand( string $notificationName)

Check if a Command is registered for a given Notification



Tags:

return:  a Command is currently registered for the given
  1. notificationName
.
access:  public


Parameters:

string   $notificationName  

[ Top ]

method initializeController [line 104]

void initializeController( )

Initialize the Singleton
instance.

Called automatically by the constructor.

Note that if you are using a subclass of

in your application, you should also subclass
and override the
method in the following way:

<listing> // ensure that the Controller is talking to my IView implementation override public function initializeController( ) : void { view = MyView.getInstance(); } </listing>




Tags:

access:  protected


[ Top ]

method registerCommand [line 144]

void registerCommand( notificationName $notificationName, commandClassRef $commandClassRef)

Register a particular
class as the handler for a particular
.

If an

has already been registered to handle
s with this name, it is no longer used, the new
is used instead.




Tags:

access:  public


Parameters:

notificationName   $notificationName   the name of the
commandClassRef   $commandClassRef   the
  1. Class
of the

[ Top ]

method removeCommand [line 165]

void removeCommand( notificationName $notificationName)

Remove a previously registered
to
mapping.



Tags:

access:  public


Parameters:

notificationName   $notificationName   the name of the
to remove the
mapping for

[ Top ]


Documentation generated on Tue, 30 Sep 2008 08:05:43 -0700 by phpDocumentor 1.4.0