Inheritance: extends QForm
<?php

require '../../../qcubed/qcubed.inc.php';
use QCubed\Plugin\QTimepickerBox;
use QCubed\Plugin\QDateTimePickerBox;
class SampleForm extends QForm
{
    protected $txtTimepicker1;
    protected $txtTimepicker2;
    protected $txtTimepicker3;
    protected function Form_Create()
    {
        $this->txtTimepicker1 = new QTimepickerBox($this);
        $this->txtTimepicker2 = new QTimepickerBox($this);
        $this->txtTimepicker2->SetStartEndHours(6, 17);
        $this->txtTimepicker2->SetStartEndIntervalMinutes(0, 45, 15);
        $this->txtTimepicker2->ShowPeriod = true;
        $this->txtTimepicker2->Rows = 2;
        $this->txtTimepicker2->ShowLeadingZero = false;
        $this->txtTimepicker3 = new QDateTimePickerBox($this);
    }
}
SampleForm::Run('SampleForm');
Exemple #2
0
    protected $street;
    protected $city;
    protected $state;
    protected $zip;
    protected $button;
    protected function Form_Create()
    {
        $this->firstName = new MyTextBox($this);
        // Normally you would use Bs\Textbox here.
        $this->firstName->Name = QApplication::Translate('First Name');
        $this->lastName = new MyTextBox($this);
        $this->lastName->Name = QApplication::Translate('Last Name');
        $this->street = new MyTextBox($this);
        $this->street->Name = QApplication::Translate('Street');
        $this->city = new MyTextBox($this);
        $this->city->Name = QApplication::Translate('City');
        $this->state = new MyTextBox($this);
        $this->state->Name = QApplication::Translate('State');
        $this->zip = new MyTextBox($this);
        $this->zip->Name = QApplication::Translate('Postal Code');
        $this->button = new MyButton($this);
        // Normally you would use Bs\Button here.
        $this->button->Text = 'OK';
    }
}
$formName = QApplication::QueryString('formName');
if (!$formName) {
    $formName = 'forms1';
}
SampleForm::Run('SampleForm', $formName . '.tpl.php');