コード例 #1
0
 public function __construct()
 {
     parent::__construct();
     // create the notebook
     $notebook = new TNotebook(400, 280);
     parent::add($notebook);
     // creates the notebook page
     $this->table = new TTable();
     // adds the notebook page
     $notebook->appendPage('Reusable view', $this->table);
     // create the form fields
     $fields[] = new TEntry('field1');
     $fields[] = $date = new TDate('field2');
     $fields[] = $text = new TText('field3');
     $fields[] = $combo = new TCombo('field4');
     $fields[] = new TPassword('field5');
     $date->setSize(100);
     $text->setSize(200, 100);
     $combo->addItems(array('1' => 'One', '2' => 'Two'));
     for ($n = 0; $n < 5; $n++) {
         // add a row for one field
         $row = $this->table->addRow();
         $row->addCell(new TLabel('Field ' . ($n + 1)));
         $row->addCell($fields[$n]);
     }
     // define wich are the form fields
     parent::setFields($fields);
 }
コード例 #2
0
ファイル: TQuickForm.class.php プロジェクト: enieber/adianti
 /**
  * Class Constructor
  * @param $name Form Name
  */
 public function __construct($name = 'my_form')
 {
     parent::__construct($name);
     // creates a table
     $this->table = new TTable();
     $this->has_action = FALSE;
     // add the table to the form
     parent::add($this->table);
 }
コード例 #3
0
 function __construct()
 {
     parent::__construct('form_conclui_venda');
     // instancia uma tabela
     $table = new TTable();
     // adiciona a tabela ao formulário
     parent::add($table);
     // cria os campos do formulário
     $cliente = new TEntry('id_cliente');
     $desconto = new TEntry('desconto');
     $valor_total = new TEntry('valor_total');
     $valor_pago = new TEntry('valor_pago');
     // define alguns atributos para os campos do formulário
     $valor_total->setEditable(FALSE);
     $cliente->setSize(100);
     $desconto->setSize(100);
     $valor_total->setSize(100);
     $valor_pago->setSize(100);
     // adiciona uma linha para o campo cliente
     $row = $table->addRow();
     $row->addCell(new TLabel('Cliente:'));
     $row->addCell($cliente);
     // adiciona uma linha para o campo desconto
     $row = $table->addRow();
     $row->addCell(new TLabel('Desconto:'));
     $row->addCell($desconto);
     // adiciona uma linha para o campo valor total
     $row = $table->addRow();
     $row->addCell(new TLabel('Valor Total:'));
     $row->addCell($valor_total);
     // adiciona uma linha para o campo valor pago
     $row = $table->addRow();
     $row->addCell(new TLabel('Valor Pago:'));
     $row->addCell($valor_pago);
     // cria um botão de ação para o formulário
     $this->button = new TButton('action1');
     // adiciona uma linha para as ações do formulário
     $row = $table->addRow();
     $row->addCell('');
     $row->addCell($this->button);
     // define quais são os campos do formulário
     parent::setFields(array($cliente, $desconto, $valor_total, $valor_pago, $this->button));
 }