当前位置: 首页>>代码示例>>PHP>>正文


PHP TEntry类代码示例

本文整理汇总了PHP中TEntry的典型用法代码示例。如果您正苦于以下问题:PHP TEntry类的具体用法?PHP TEntry怎么用?PHP TEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TQuickForm('form_SystemProgram');
     $this->form->setFormTitle(_t('Program'));
     $this->form->class = 'tform';
     // CSS class
     // defines the database
     parent::setDatabase('permission');
     // defines the active record
     parent::setActiveRecord('SystemProgram');
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $controller = new TEntry('controller');
     $id->setEditable(false);
     // add the fields
     $this->form->addQuickField('ID', $id, 50);
     $this->form->addQuickField(_t('Name') . ': ', $name, 200);
     $this->form->addQuickField(_t('Controller') . ': ', $controller, 200);
     // validations
     $name->addValidation(_t('Name'), new TRequiredValidator());
     $controller->addValidation('Controller', new TRequiredValidator());
     // add form actions
     $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png');
     $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('SystemProgramList', 'onReload')), 'ico_datagrid.png');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemProgramList'));
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
开发者ID:jfrank1500,项目名称:curso_php,代码行数:39,代码来源:SystemProgramForm.class.php

示例2: __construct

 function __construct()
 {
     parent::__construct();
     $this->form = new TQuickForm('form_Contribuinte');
     $this->form->setFormTitle('Contribuinte');
     $this->form->class = 'tform';
     parent::setDatabase('liger');
     parent::setActiveRecord('Contribuinte');
     $contribuinte_id = new TEntry('contribuinte_id');
     $contribuinte_nome = new TEntry('contribuinte_nome');
     $contribuinte_tipo = new TCombo('contribuinte_tipo');
     $contribuinte_endereco = new TEntry('contribuinte_endereco');
     $contribuinte_bairro = new TEntry('contribuinte_bairro');
     $contribuinte_cidade = new TEntry('contribuinte_cidade');
     $contribuinte_estado = new TDBCombo('tb_estados_uf_id', 'liger', 'Estado', 'uf_id', 'uf_nome');
     $contribuinte_cep = new TEntry('contribuinte_cep');
     $contribuinte_telefone = new TEntry('contribuinte_telefone');
     $contribuinte_cpf = new TEntry('contribuinte_cpf');
     $contribuinte_dtnascimento = new TDate('contribuinte_dtnascimento');
     $contribuinte_rg = new TEntry('contribuinte_rg');
     $contribuinte_cnpj = new TEntry('contribuinte_cnpj');
     $contribuinte_inscricaoestadual = new TEntry('contribuinte_inscricaoestadual');
     $contribuinte_inscricaomunicipal = new TEntry('contribuinte_inscricaomunicipal');
     $contribuinte_regjuceg = new TEntry('contribuinte_regjuceg');
     $contribuinte_ramo = new TEntry('contribuinte_ramo');
     $contribuinte_codatividade = new TEntry('contribuinte_codatividade');
     $contribuinte_numempregados = new TEntry('contribuinte_numempregados');
     $contribuinte_inicioatividades = new TDate('contribuinte_inicioatividades');
     $tipo = array(1 => "Físico", 2 => "Jurídico");
     $contribuinte_id->setEditable(false);
     $contribuinte_tipo->addItems($tipo);
     $this->form->addQuickField('ID', $contribuinte_id, 100);
     $this->form->addQuickField('Nome/Razão Social', $contribuinte_nome, 400);
     $this->form->addQuickField('Tipo', $contribuinte_tipo, 200);
     $this->form->addQuickField('Endereço', $contribuinte_endereco, 400);
     $this->form->addQuickField('Bairro', $contribuinte_bairro, 200);
     $this->form->addQuickField('Cidade', $contribuinte_cidade, 200);
     $this->form->addQuickField('Estado', $contribuinte_estado, 200);
     $this->form->addQuickField('CEP', $contribuinte_cep, 200);
     $this->form->addQuickField('Telefone', $contribuinte_telefone, 200);
     $this->form->addQuickField('CPF', $contribuinte_cpf, 200);
     $this->form->addQuickField('Data de Nascimento', $contribuinte_dtnascimento, 200);
     $this->form->addQuickField('RG', $contribuinte_rg, 200);
     $this->form->addQuickField('CNPJ', $contribuinte_cnpj, 200);
     $this->form->addQuickField('Inscrição Municipal', $contribuinte_inscricaomunicipal, 200);
     $this->form->addQuickField('Inscrição Estadual', $contribuinte_inscricaoestadual, 200);
     $this->form->addQuickField('Registro JUCEG', $contribuinte_regjuceg, 200);
     $this->form->addQuickField('Ramo', $contribuinte_ramo, 200);
     $this->form->addQuickField('Código de Atividade', $contribuinte_codatividade, 200);
     $this->form->addQuickField('Nº de Empregados', $contribuinte_numempregados, 200);
     $this->form->addQuickField('Início das Atividades', $contribuinte_inicioatividades, 200);
     $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png');
     $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('ContribuinteList', 'onReload')), 'ico_datagrid.png');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'ContribuinteList'));
     $container->addRow()->addCell($this->form);
     parent::add($container);
 }
开发者ID:eduardojsouza,项目名称:liger,代码行数:60,代码来源:ContribuinteForm.class.php

示例3: __construct

 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the form using TQuickForm class
     $this->form = new BootstrapFormWrapper(new TQuickForm());
     $this->form->setFormTitle('cadastroTarefas');
     // create the form fields
     $id = new TEntry('id');
     $id->setEditable(FALSE);
     $description = new TEntry('titulo');
     $list = new TCombo('prioridade');
     $text = new TText('descricao');
     $combo_items = array();
     $combo_items['1'] = 'Baixa';
     $combo_items['2'] = 'Media';
     $combo_items['3'] = 'Alta';
     $list->addItems($combo_items);
     // add the fields inside the form
     $this->form->addQuickField('Id', $id, 40);
     $this->form->addQuickField('Título', $description, 250);
     $this->form->addQuickField('Descrição', $text, 120);
     $this->form->addQuickField('Prioridade', $list, 120);
     $text->setSize(250, 50);
     // define the form action
     $btn = $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'fa:save');
     $btn->class = 'btn btn-success';
     $panel = new TPanelGroup('Cadastro de taredas');
     $panel->add($this->form);
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add($panel);
     parent::add($vbox);
 }
开发者ID:GustavoEmmel,项目名称:exercicioPHP,代码行数:37,代码来源:FormBootstrapView.class.php

示例4: __construct

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     parent::setDatabase('samples');
     // defines the database
     parent::setActiveRecord('City');
     // defines the active record
     // creates the form
     $this->form = new TQuickForm('form_City');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 500px';
     // define the form title
     $this->form->setFormTitle('Standard Form');
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $id->setEditable(FALSE);
     // add the form fields
     $this->form->addQuickField('ID', $id, 100);
     $this->form->addQuickField('Name', $name, 100);
     // define the form action
     $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction('New', new TAction(array($this, 'onEdit')), 'ico_new.png');
     $this->form->addQuickAction('Listing', new TAction(array('StandardDataGridView', 'onReload')), 'ico_datagrid.gif');
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
开发者ID:jfrank1500,项目名称:curso_php,代码行数:35,代码来源:StandardFormView.class.php

示例5: __construct

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TQuickForm('form_Bairro');
     $this->form->setFormTitle('Bairro');
     $this->form->class = 'tform';
     // CSS class
     // defines the database
     parent::setDatabase('liger');
     // defines the active record
     parent::setActiveRecord('Bairro');
     // create the form fields
     $bairros_id = new TEntry('bairros_id');
     $bairros_nome = new TEntry('bairros_nome');
     $tb_cidades_cid_id = new TDBCombo('tb_cidades_cid_id', 'liger', 'Cidade', 'cid_id', 'cid_nome');
     $bairros_id->setEditable(false);
     // add the fields
     $this->form->addQuickField('ID', $bairros_id, 50);
     $this->form->addQuickField('Bairro: ', $bairros_nome, 200);
     $this->form->addQuickField('Cidade: ', $tb_cidades_cid_id, 200);
     // add form actions
     $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction(_t('New'), new TAction(array($this, 'onEdit')), 'ico_new.png');
     $this->form->addQuickAction(_t('Back to the listing'), new TAction(array('BairroList', 'onReload')), 'ico_datagrid.png');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'BairroList'));
     $container->addRow()->addCell($this->form);
     // add the form to the page
     parent::add($container);
 }
开发者ID:eduardojsouza,项目名称:liger,代码行数:36,代码来源:BairroForm.class.php

示例6: __construct

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the notebook
     $this->notebook = new TNotebook();
     $this->notebook->setSize(400, 170);
     // creates the form
     $this->form = new TQuickForm('form_account');
     $this->notebook->appendPage('Personal details', $this->form);
     // create the form fields
     $email = new TEntry('email');
     $first_name = new TEntry('first_name');
     $last_name = new TEntry('last_name');
     $phone = new TEntry('phone');
     $email->setEditable(FALSE);
     // add the fields
     $this->form->addQuickField('Email: ', $email, 200);
     $this->form->addQuickField('First name: ', $first_name, 200);
     $this->form->addQuickField('Last name: ', $last_name, 200);
     $this->form->addQuickField('Phone: ', $phone, 200);
     // validations
     $first_name->addValidation('First name', new TRequiredValidator());
     $last_name->addValidation('Last name', new TRequiredValidator());
     $phone->addValidation('Phone', new TRequiredValidator());
     // add a form action
     $this->form->addQuickAction('Confirm', new TAction(array($this, 'onConfirm')), 'ico_apply.png');
     $this->form->addQuickAction('Back', new TAction(array($this, 'onBackForm')), 'ico_back.png');
     // add the form to the page
     parent::add($this->notebook);
 }
开发者ID:jfrank1500,项目名称:curso_php,代码行数:34,代码来源:MultiStepMultiForm2View.class.php

示例7: __construct

 /**
  * Class constructor
  * Creates the page
  */
 function __construct()
 {
     parent::__construct();
     // create the form using TQuickForm class
     $this->form = new TQuickForm('form_seek_sample');
     $this->form->setFormTitle('Seek button');
     $this->form->class = 'tform';
     // create the form fields
     $city_id1 = new TSeekButton('city_id1');
     $city_name1 = new TEntry('city_name1');
     $criteria = new TCriteria();
     $criteria->add(new TFilter('id', '>', 1));
     $criteria->add(new TFilter('id', '<', 5));
     $criteria->setProperty('order', 'name');
     // define the action for city_id1
     $obj = new TestCitySeek();
     $action = new TAction(array($obj, 'onReload'));
     $city_id1->setAction($action);
     $city_id1->setSize(100);
     $city_name1->setEditable(FALSE);
     $this->form->addQuickFields('Manual SeekButton', array($city_id1, $city_name1));
     $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'fa:floppy-o');
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add($this->form);
     parent::add($vbox);
 }
开发者ID:jhonleandres,项目名称:Atividades,代码行数:31,代码来源:FormSeekButtonView.class.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->form = new TQuickForm();
     $this->form->class = 'tform';
     $this->form->setFormTitle(_t('Profile'));
     $name = new TEntry('name');
     $login = new TEntry('login');
     $email = new TEntry('email');
     $password1 = new TPassword('password1');
     $password2 = new TPassword('password2');
     $login->setEditable(FALSE);
     $this->form->addQuickField(_t('Name'), $name, '80%', new TRequiredValidator());
     $this->form->addQuickField(_t('Login'), $login, '80%', new TRequiredValidator());
     $this->form->addQuickField(_t('Email'), $email, '80%', new TRequiredValidator());
     $table = $this->form->getContainer();
     $row = $table->addRow();
     $row->style = 'background: #FFFBCB;';
     $cell = $row->addCell(new TLabel(_t('Change password') . ' (' . _t('Leave empty to keep old password') . ')'));
     $cell->colspan = 2;
     $this->form->addQuickField(_t('Password'), $password1, '80%');
     $this->form->addQuickField(_t('Password confirmation'), $password2, '80%');
     $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'fa:save');
     $bc = new TBreadCrumb();
     $bc->addHome();
     $bc->addItem('Profile');
     $container = TVBox::pack($bc, $this->form);
     $container->style = 'width:80%';
     parent::add($container);
 }
开发者ID:edurbs,项目名称:sobcontrole,代码行数:30,代码来源:SystemProfileForm.class.php

示例9: __construct

 /**
  * Class constructor
  * Cria da página e o formulário de registro
  */
 function __construct()
 {
     parent::__construct();
     // cria o formulário
     $this->form = new TQuickForm('form_Funcionalidade');
     $this->form->setFormTitle('Cadastro de Funcionalidades');
     $this->form->class = 'tform';
     // CSS class
     // Cria os campos do formulário
     $id = new TEntry('id');
     $nome = new TEntry('nome');
     $classe = new TEntry('classe');
     $id->setEditable(false);
     // Adiciona os campos ao formulário
     $this->form->addQuickField('Código:', $id, 50);
     $this->form->addQuickField('Nome: ', $nome, 500);
     $this->form->addQuickField('Classe de controle: ', $classe, 500);
     // Validadores
     $nome->addValidation('Nome', new TRequiredValidator());
     $classe->addValidation('Classe de controle', new TRequiredValidator());
     // Adiciona as ações do formulário
     $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png');
     $this->form->addQuickAction('Novo', new TAction(array($this, 'onEdit')), 'ico_new.png');
     $this->form->addQuickAction('Voltar para a listagem', new TAction(array('FuncionalidadeList', 'onReload')), 'ico_datagrid.png');
     $container = new TTable();
     $container->style = 'width: 80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'FuncionalidadeList'));
     $container->addRow()->addCell($this->form);
     // Adiciona o formulário a pagina
     parent::add($container);
 }
开发者ID:andermall,项目名称:tcc,代码行数:35,代码来源:FuncionalidadeForm.class.php

示例10: __construct

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     $table = new TTable();
     $table->width = '100%';
     // creates the form
     $this->form = new TForm('form_login');
     $this->form->class = 'tform';
     $this->form->style = 'margin:auto;width: 350px';
     // add the notebook inside the form
     $this->form->add($table);
     // create the form fields
     $login = new TEntry('login');
     $password = new TPassword('password');
     // define the sizes
     $login->setSize(150, 40);
     $password->setSize(150, 40);
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onLogin')), _t('Login'));
     $save_button->setImage('ico_apply.png');
     // add a row for the field login
     $row = $table->addRow();
     $cell = $row->addCell(new TLabel('Login'));
     $cell->colspan = 2;
     $row->class = 'tformtitle';
     $table->addRowSet(new TLabel(_t('User') . ': '), $login);
     $table->addRowSet(new TLabel(_t('Password') . ': '), $password);
     $row = $table->addRowSet($save_button, '');
     $row->class = 'tformaction';
     $this->form->setFields(array($login, $password, $save_button));
     // add the form to the page
     parent::add($this->form);
 }
开发者ID:cbsistem,项目名称:templateERP_Bootstrap,代码行数:38,代码来源:LoginForm.class.php

示例11: __construct

 /**
  * Class constructor
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_pdf_shapes');
     // creates a table
     $table = new TTable();
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $name = new TEntry('name');
     $name->addValidation('Name', new TRequiredValidator());
     $label = new TLabel('Name' . ': ');
     $label->setFontColor('red');
     $table->addRowSet($label, $name);
     $save_button = new TButton('generate');
     $save_button->setAction(new TAction(array($this, 'onGenerate')), 'Generate');
     $save_button->setImage('ico_save.png');
     // add a row for the form action
     $table->addRowSet($save_button);
     // define wich are the form fields
     $this->form->setFields(array($name, $save_button));
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
开发者ID:jfrank1500,项目名称:curso_php,代码行数:31,代码来源:PDFDesignShapesView.class.php

示例12: __construct

 public function __construct()
 {
     parent::__construct();
     // instancia um formulário
     $this->form = new TForm('form_relat_vendas');
     // instancia uma tabela
     $table = new TTable();
     // adiciona a tabela ao formulário
     $this->form->add($table);
     // cria os campos do formulário
     $data_ini = new TEntry('data_ini');
     $data_fim = new TEntry('data_fim');
     // define os tamanhos
     $data_ini->setSize(100);
     $data_fim->setSize(100);
     // adiciona uma linha para o campo data inicial
     $row = $table->addRow();
     $row->addCell(new TLabel('Data Inicial:'));
     $row->addCell($data_ini);
     // adiciona uma linha para o campo data final
     $row = $table->addRow();
     $row->addCell(new TLabel('Data Final:'));
     $row->addCell($data_fim);
     // cria um botão de ação
     $gera_button = new TButton('gera');
     // define a ação do boão
     $gera_button->setAction(new TAction(array($this, 'onGera')), 'Gerar Relatório');
     // adiciona uma linha para a ação do formulário
     $row = $table->addRow();
     $row->addCell($gera_button);
     // define quais são os campos do formulário
     $this->form->setFields(array($data_ini, $data_fim, $gera_button));
     // adiciona o formulário à página
     parent::add($this->form);
 }
开发者ID:CodeBooks,项目名称:php-programando-com-orientacao-a-objetos,代码行数:35,代码来源:RelatorioForm.class.php

示例13: __construct

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // security check
     if (TSession::getValue('logged') !== TRUE) {
         throw new Exception(_t('Not logged'));
     }
     // security check
     TTransaction::open('library');
     if (User::newFromLogin(TSession::getValue('login'))->role->mnemonic !== 'LIBRARIAN') {
         throw new Exception(_t('Permission denied'));
     }
     TTransaction::close();
     // defines the database
     parent::setDatabase('library');
     // defines the active record
     parent::setActiveRecord('Publisher');
     // creates the form
     $this->form = new TQuickForm('form_Publisher');
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     $id->setEditable(FALSE);
     // define the sizes
     $this->form->addQuickField(_t('Code'), $id, 100);
     $this->form->addQuickField(_t('Name'), $name, 200);
     // define the form action
     $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'ico_save.png');
     // add the form to the page
     parent::add($this->form);
 }
开发者ID:jhonleandres,项目名称:crmbf,代码行数:35,代码来源:PublisherForm.class.php

示例14: __construct

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the form
     $this->form = new TForm('form_City');
     $this->form->class = 'tform';
     // CSS class
     $this->form->style = 'width: 500px';
     // creates a table
     $table = new TTable();
     $table->width = '100%';
     $table_buttons = new TTable();
     // add the table inside the form
     $this->form->add($table);
     // create the form fields
     $id = new TEntry('id');
     $name = new TEntry('name');
     // define the sizes
     $id->setSize(100);
     $name->setSize(100);
     $id->setEditable(FALSE);
     // define the form title
     $row = $table->addRow();
     $row->class = 'tformtitle';
     $cell = $row->addCell(new TLabel('Manual form'));
     $cell->colspan = 2;
     // add the form fields
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel('Name:'), $name);
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), 'Save');
     $save_button->setImage('ico_save.png');
     // create an action button (new)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), 'New');
     $new_button->setImage('ico_new.png');
     // create an action button (go to list)
     $goto_button = new TButton('list');
     $goto_button->setAction(new TAction(array('CompleteDataGridView', 'onReload')), 'Listing');
     $goto_button->setImage('ico_datagrid.gif');
     // add a row for the form action
     $row = $table_buttons->addRow();
     $row->addCell($save_button);
     $row->addCell($new_button);
     $row->addCell($goto_button);
     // add a row for the form action
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($table_buttons);
     $cell->colspan = 2;
     // define wich are the form fields
     $this->form->setFields(array($id, $name, $save_button, $new_button, $goto_button));
     // wrap the page content using vertical box
     $vbox = new TVBox();
     $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
     $vbox->add($this->form);
     parent::add($vbox);
 }
开发者ID:jfrank1500,项目名称:curso_php,代码行数:63,代码来源:CompleteFormView.class.php

示例15: __construct

 /**
  * Class constructor
  * Creates the page and the registration form
  */
 function __construct()
 {
     parent::__construct();
     // creates the table container
     $table = new TTable();
     $table->style = 'width:100%';
     // creates the form
     $this->form = new TForm('form_System_Provider');
     $this->form->class = 'tform';
     // add the notebook inside the form
     $this->form->add($table);
     $row1 = $table->addRow();
     $row1->class = 'tformtitle';
     $cell1 = $row1->addCell(new TLabel('Add new provider'), '');
     $cell1->colspan = 2;
     // create the form fields
     $id = new TEntry('id');
     $nif = new TEntry('nif');
     $name = new TEntry('name');
     $id->setEditable(false);
     // define the sizes
     $id->setSize(100);
     $nif->setSize(300);
     $name->setSize(300);
     // validations
     $nif->addValidation('nif', new TRequiredValidator());
     $name->addValidation('name', new TRequiredValidator());
     // add a row for the field id
     $table->addRowSet(new TLabel('ID:'), $id);
     $table->addRowSet(new TLabel('NIF: '), $nif);
     $table->addRowSet(new TLabel('Name: '), $name);
     // create an action button (save)
     $save_button = new TButton('save');
     $save_button->setAction(new TAction(array($this, 'onSave')), _t('Save'));
     $save_button->setImage('fa:floppy-o');
     // create an new button (edit with no parameters)
     $new_button = new TButton('new');
     $new_button->setAction(new TAction(array($this, 'onEdit')), _t('New'));
     $new_button->setImage('fa:plus-square green');
     $list_button = new TButton('list');
     $list_button->setAction(new TAction(array('SystemProvidersList', 'onReload')), _t('Back to the listing'));
     $list_button->setImage('fa:table blue');
     // define the form fields
     $this->form->setFields(array($id, $nif, $name, $save_button, $new_button, $list_button));
     $buttons = new THBox();
     $buttons->add($save_button);
     $buttons->add($new_button);
     $buttons->add($list_button);
     $container = new TTable();
     $container->width = '80%';
     $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemProvidersList'));
     $container->addRow()->addCell($this->form);
     $row = $table->addRow();
     $row->class = 'tformaction';
     $cell = $row->addCell($buttons);
     $cell->colspan = 2;
     // add the form to the page
     parent::add($container);
 }
开发者ID:kiibe,项目名称:linkERP,代码行数:63,代码来源:SystemProvidersForm.class.php


注:本文中的TEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。