Пример #1
0
use gossi\webform\Webform;
use gossi\webform\Color;
use gossi\webform\Area;
use gossi\webform\Submit;
use gossi\webform\Url;
use gossi\webform\Tel;
use gossi\webform\Email;
use gossi\webform\Number;
use gossi\webform\Range;
use gossi\webform\Date;
use gossi\webform\Time;
use gossi\webform\DateTime;
use gossi\webform\SingleLine;
include '../src/Autoload.php';
//include '../build/gossi-webform.phar';
$wf = new Webform(array('target' => $_SERVER['PHP_SELF']));
$wf->setLayout(Webform::LAYOUT_TABLE);
$personal = new Area($wf, array('label' => 'Personal Data', 'columns' => 2));
$left = new Area($personal, array('classes' => 'webform-area-blind'));
$firstName = new SingleLine($left, array('label' => 'First Name', 'required' => true));
$lastName = new SingleLine($left, array('label' => 'Last Name', 'required' => true));
$birthday = new Date($left, array('label' => 'Birthday', 'prependClass' => 'icon-date'));
$birthweek = new Week($left, array('label' => 'Birthweek'));
$birthtime = new Time($left, array('label' => 'Birthtime'));
$birth = new DateTime($left, array('label' => 'Birth'));
$sex = new Group($left, array('label' => 'Sex'));
$male = new Radio($sex, array('label' => 'Male', 'value' => 'm'));
$female = new Radio($sex, array('label' => 'Female', 'value' => 'f'));
$right = new Area($personal, array('classes' => 'webform-area-blind'));
$size = new Number($right, array('label' => 'Size'));
$weight = new Number($right, array('label' => 'Weight'));
Пример #2
0
 public static function parseXMLDoc(\DOMDocument $doc)
 {
     return Webform::parseXMLNode($doc->documentElement);
 }