Property | Type | Description | |
---|---|---|---|
$_controller | Holds the reference of current controller | ||
$action | Holds the current action of the controller | ||
$autoComplete | Turns on or off auto loading session data to Controller::data. | ||
$autoRedirect | Turns on or off auto redirect when data passes validation or session data of previous action is empty. | ||
$automation | When Array given, This automate within these key as actions. Example. beforeFilter in controller $this->Transition->automation = array( 'action' => array( 'nextStep' => 'nextAction', 'models' => array('Model1', 'Model2'), 'prev' => 'prevAction', 'validationMethod' => array(&$this->Model3, 'behaviorMethod'), 'messages' => array( 'invalid' => __('your input was wrong.', true), 'prev' => __('wrong transition.', true), ), ) ); | ||
$components | Components to use. | ||
$flashParams | "element" key Element to wrap flash message in. "params" key , Parameters to be sent to layout as view variables. "key" key , Message key, default is 'flash'. | ||
$messages | "invalid" key , When it cannot pass validation. "prev" key , When session has no data for previous action. | ||
$models | Default models. | ||
$sessionBaseKey | Base of session key | ||
$validationMethod | Default validation method. |
Method | Description | |
---|---|---|
_autoLoadModels ( mixed $models ) : mixed | Loading Default/UserSetting Model names. | |
allData ( ) : mixed | Get all of session data. | |
automate ( mixed $nextStep, mixed $models = null, mixed $prev = null, callback $validationMethod = null, array $messages = [] ) : boolean | Automation method. | |
checkData ( mixed $nextStep = null, mixed $models = null, callback $validationMethod = null, $message = null, string $sessionKey = null ) : boolean | Checking data of current controller with auto validation , auto redirection , auto setFlash() , and auto restoring data | |
checkPrev ( mixed $prev, string $message = null, string $prevAction = null ) : boolean | Check previous session data. | |
clearData ( ) : boolean | Clear Session data. | |
data ( string $key ) : mixed | Get session data from key. | |
delData ( string $key ) : boolean | Alias for deleteData(). | |
deleteData ( string $key ) : boolean | Delete Session data from key. | |
initialize ( object &$controller, array $settings = [] ) : void | Initialize the TransitionComponent | |
mergedData ( string $callback = 'Set::merge' ) : mixed | Get merged session data. | |
sessionKey ( string $key, string $cname = null ) : string | Get Session key. | |
setData ( string $key, mixed $data ) : boolean | Set session data with key. | |
startup ( object &$controller ) : void | Component startup. Given automation options , It will automate. | |
validateModel ( $model, callback $validationMethod = null ) : boolean | Validation with model name. |
public _autoLoadModels ( mixed $models ) : mixed | ||
$models | mixed | a name or array of names |
return | mixed | Session data or null |
public automate ( mixed $nextStep, mixed $models = null, mixed $prev = null, callback $validationMethod = null, array $messages = [] ) : boolean | ||
$nextStep | mixed | Next step url (will be given Controller::redirect()) |
$models | mixed | Models for validation |
$prev | mixed | Previous action for check |
$validationMethod | callback | Method to validate |
$messages | array | Messages to Controller::setFlash() |
return | boolean | Success |
public checkData ( mixed $nextStep = null, mixed $models = null, callback $validationMethod = null, $message = null, string $sessionKey = null ) : boolean | ||
$nextStep | mixed | Next step url (will be passed to Controller::redirect()) |
$models | mixed | Models for validation |
$validationMethod | callback | Method to validate |
$sessionKey | string | Session key to store |
return | boolean | Success |
public deleteData ( string $key ) : boolean | ||
$key | string | Key name |
return | boolean | Success |
public mergedData ( string $callback = 'Set::merge' ) : mixed | ||
$callback | string | Callback method to merging. valid callback type or Sring like "Set::merge" can be accepted.(optional) |
return | mixed | Merged session data or null |
public validateModel ( $model, callback $validationMethod = null ) : boolean | ||
$validationMethod | callback | Method to validate |
return | boolean | Success |
public $autoComplete |
public $autoRedirect |
public $automation |
public $flashParams |
public $messages |