Source for file wizard.php
Documentation is available at wizard.php
* Example 2 for HTML_QuickForm_Controller: Wizard
* @version SVN: $Id: wizard.php 289084 2009-10-02 06:53:09Z avb $
* @author Alexey Borzov <avb@php.net>
require_once 'HTML/QuickForm/Controller.php';
// Load some default action handlers
require_once 'HTML/QuickForm/Action/Next.php';
require_once 'HTML/QuickForm/Action/Back.php';
require_once 'HTML/QuickForm/Action/Jump.php';
require_once 'HTML/QuickForm/Action/Display.php';
// Start the session, form-page values will be kept there
$this->_formBuilt = true;
$this->addElement ('header', null , 'Wizard page 1 of 3');
$radio[] = &$this->createElement ('radio', null , null , 'Yes', 'Y');
$radio[] = &$this->createElement ('radio', null , null , 'No', 'N');
$this->addGroup ($radio, 'iradYesNo', 'Are you absolutely sure?');
$this->addElement ('submit', $this->getButtonName('next'), 'Next >>');
$this->addRule ('iradYesNo', 'Check Yes or No', 'required');
$this->_formBuilt = true;
$this->addElement ('header', null , 'Wizard page 2 of 3');
$name['last'] = &$this->createElement ('text', 'last', null , array ('size' => 30 ));
$name['first'] = &$this->createElement ('text', 'first', null , array ('size' => 20 ));
$this->addGroup ($name, 'name', 'Name (last, first):', ', ');
$prevnext[] = & $this->createElement ('submit', $this->getButtonName('back'), '<< Back');
$prevnext[] = & $this->createElement ('submit', $this->getButtonName('next'), 'Next >>');
$this->addGroup ($prevnext, null , '', ' ', false );
$this->addGroupRule ('name', array ('last' => array (array ('Last name is required', 'required'))));
$this->_formBuilt = true;
$this->addElement ('header', null , 'Wizard page 3 of 3');
$this->addElement ('textarea', 'itxaTest', 'Parting words:', array ('rows' => 5 , 'cols' => 40 ));
$prevnext[] = & $this->createElement ('submit', $this->getButtonName('back'), '<< Back');
$prevnext[] = & $this->createElement ('submit', $this->getButtonName('next'), 'Finish');
$this->addGroup ($prevnext, null , '', ' ', false );
$this->addRule ('itxaTest', 'Say something!', 'required');
function perform(&$page, $actionName)
echo "Submit successful!<br>\n<pre>\n";
var_dump($page->controller ->exportValues ());
// We actually add these handlers here for the sake of example
// They can be automatically loaded and added by the controller
// This is the action we should always define ourselves
Documentation generated on Mon, 11 Mar 2019 15:34:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|