[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/controller/ -> sequentialcontroller.class.php (sommaire)

(pas de description)

Poids: 151 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 2 fois
Nécessite: 0 fichiers

Définit 1 class

SequentialController:: (4 méthodes):
  SequentialController()
  getNextStep()
  getCurrentStep()
  process()


Classe: SequentialController  - X-Ref

\ingroup Controller

This is a simplified version of the Controller pattern that executes its actions in a
pre-defined sequence. This allows to easily create multi-step forms that are executed
only in the pre-defined order.

This controller uses the session to store its current position in the list of steps/action
and it will use it to compute its next step after the next request. Support for sessions
on both the client side and the server side is required.

The next step in the sequence will be calculated based on the outcome of the action that
was last executed: if the validate() method or the perform() method both returned true, then
the controller will proceed to execute the next action. If either of the conditions above
was not true, this controller will keep retrying the current step until successful. If you are
having problems with this controller executing the same action class over and over again,
make sure you are not returning 'false' from any of those two methods.

If you'd like to restart the sequence of this controller, please include a "start=1" parameter
in any request.

Please see the RegistrationController class for a simple example of how to use
this controller.

SequentialController( $steps )   X-Ref
Constructor of the class.

param: steps An array containing the name of the action classes that are going to be
return: Nothing

getNextStep( $currentStep )   X-Ref
Returns the next step in the sequence based on the current step

param: currentStep The current step in the sequence
return:

getCurrentStep()   X-Ref
Returns the current step, based on the contents from the session. If there is
no information in the session, processing will start at the action class whose
index in the sequence array is '0'

return: The current step in the sequence

process( $httpRequest )   X-Ref
Main method of the controller, as it processes the current HTTP request. Since this is a sequential
controller, it does not take into account any of the parameters in the request (as opposed to a normal
Controller class, which would for example check the "op" parameter) but it instead relies on its
internal counter and the outcome of the last action to find out which action to execute next.

param: httpRequest The current HTTP Request
return: Always true



Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics