api.zedseries.com
[ class tree: Wizard ] [ index: Wizard ] [ all elements ]

Class: ZedSeriesWizard

Source Location: /ZedSeriesWizard.php

Class ZedSeriesWizard

Class Overview

Class ZedSeriesWizard

let you create a wizard in an easy way

with ZedSeriesWizard you can create a wizard in an easy manner with custom step validation

its configuration is entirely based on ini file so you can change it without touching the code

the ini file allows you to separate backend and frontend ui settings, so you can load some css in the frontend but not in backend or using different template in BE and FE

for a complete overview of the ini settings that can be applied please refer to WizardConfig Documentation page
(on http://www.zedseries.com if you are reading this from source :) )

Quick start:

Create an array of steps, inside this array place an array of Widget inherited classes:

In the examples below I use prepareForWidget Controller's function for creating Widget more easily, <br /> this is the recommended way of creating Widget since using prepareForWidget you can borrow settings (the first parameter of the function) from field dca's entry

  1. $steps = array();
  2.  
  3. $steps[0] = array(
  4.                  new FormTextField(
  5.                         $this->prepareForWidget(
  6.                                 array(
  7.                                     'label' => array('name', 'please insert your name'),
  8.                                     'eval'  => array('mandatory'=>true)
  9.                                 ), 'name'
  10.                         )
  11.                      ),
  12.                      
  13.                  new FormTextField(
  14.                         $this->prepareForWidget(
  15.                                 array(
  16.                                     'label' => array('surname', 'please insert your surname'),
  17.                                     'eval'  => array('mandatory'=>true)
  18.                                 ), 'surname'
  19.                         )
  20.                      )
  21.                  );
  22.                  
  23.                  
  24. $steps[1] = array(
  25.  
  26.  
  27. );

Located in /ZedSeriesWizard.php [line 46]

Controller
   |
   --ZedSeriesWizard
Author(s): Information Tags:
Copyright:  Angelo Galleja 2008,2009,2010

Properties

Methods

[ Top ]
Property Summary
mixed   $config  
mixed   $currentStep  
mixed   $formCfg  
mixed   $steps  
mixed   $strTemplate  
mixed   $validationCallback  
mixed   $wz_values  

[ Top ]
Method Summary
ZedSeriesWizard   __construct()  
void   addCallback()  
void   addWidget()   add a widget after initial setup
void   getValues()  
void   getWidgets()   return a widget array for the current step
void   loadConfig()  
void   parseTemplate()  
void   processStep()  
void   run()   run the wizard :O
void   validateStep()   validate current step
void   walk()  
void   __get()   TODO:

[ Top ]
Properties
mixed   $config = array() [line 52]
API Tags:
Access:  protected


[ Top ]
mixed   $currentStep = null [line 49]
API Tags:
Access:  protected


[ Top ]
mixed   $formCfg = array() [line 53]
API Tags:
Access:  protected


[ Top ]
mixed   $steps = array() [line 50]
API Tags:
Access:  protected


[ Top ]
mixed   $strTemplate = 'wizard' [line 54]
API Tags:
Access:  protected


[ Top ]
mixed   $validationCallback = array() [line 56]
API Tags:
Access:  protected


[ Top ]
mixed   $wz_values = array() [line 51]
API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 73]

  ZedSeriesWizard __construct( array $steps, [array $validationCallback = array()], mixed $wzConfig  )

Parameters:
array   $steps: 

a configuration array like:

array( $widget, $widget array()

array   $validationCallback:  a callback array like: 'fieldname' => array(new class(), 'methodname')
mixed   $wzConfig:  name of ini file or instanceof ZedSeriesIniConfigWizard

API Tags:
Access:  public


[ Top ]
addCallback  [line 131]

  void addCallback( string $fieldname, mixed $callback  )

Parameters:
string   $fieldname:  related fieldname
mixed   $callback:  callback to invoke for $fieldname validation

API Tags:
Access:  public


[ Top ]
addWidget  [line 143]

  void addWidget( $step, $widget  )

add a widget after initial setup

useful if you want to show some widgets depending on the previous step

Parameters:
   $step: 
   $widget: 

API Tags:
Access:  public


[ Top ]
getValues  [line 166]

  void getValues( )


API Tags:
Access:  public


[ Top ]
getWidgets  [line 306]

  void getWidgets( $arrStep, [ $disable = false]  )

return a widget array for the current step

Parameters:
   $arrStep: 
   $disable: 

API Tags:
Access:  protected


[ Top ]
loadConfig  [line 194]

  void loadConfig( )


API Tags:
Access:  protected


[ Top ]
parseTemplate  [line 392]

  void parseTemplate( )


API Tags:
Access:  protected


[ Top ]
processStep  [line 266]

  void processStep( )


API Tags:
Access:  protected


[ Top ]
run  [line 189]

  void run( )

run the wizard :O


API Tags:
Access:  public


[ Top ]
validateStep  [line 341]

  void validateStep( )

validate current step

if the widget is (instanceof) uploadable the validationCallback will not be called


API Tags:
Access:  protected


[ Top ]
walk  [line 170]

  void walk( )


API Tags:
Access:  protected


[ Top ]
__get  [line 161]

  void __get( $name  )

TODO:

add __empty and __isset function test with PHP BUG #43936

Parameters:
   $name: 

API Tags:
Access:  public


[ Top ]

Documentation generated on Fri, 22 Oct 2010 17:37:34 +0200 by phpDocumentor 1.4.1