Source for file simple.php
Documentation is available at simple.php
* Example 1 for HTML_QuickForm_Controller: using the Controller
* infrastructure to create and process the basic single-page form
* @version SVN: $Id: simple.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/Submit.php';
require_once 'HTML/QuickForm/Action/Display.php';
$this->_formBuilt = true;
$this->addElement ('header', null , 'Controller example 1: a simple form');
$this->addElement ('text', 'tstText', 'Please enter something:', array ('size'=>20 , 'maxlength'=>50 ));
// Bind the button to the 'submit' action
$this->addElement ('submit', $this->getButtonName('submit'), 'Send');
$this->applyFilter ('tstText', 'trim');
$this->addRule ('tstText', 'Pretty please!', 'required');
function perform(&$page, $actionName)
echo "Submit successful!<br>\n<pre>\n";
// 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
$controller->addPage ($page);
Documentation generated on Mon, 11 Mar 2019 15:34:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|