本文整理汇总了PHP中TPage::add方法的典型用法代码示例。如果您正苦于以下问题:PHP TPage::add方法的具体用法?PHP TPage::add怎么用?PHP TPage::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPage
的用法示例。
在下文中一共展示了TPage::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TImage
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
$image = new TImage('app/images/frontpage.png');
// add the image to the page
parent::add($image);
}
示例2: __construct
public function __construct()
{
parent::__construct();
// creates one datagrid
$this->datagrid = new TDataGrid();
// make scrollable and define height
$this->datagrid->setHeight(300);
$this->datagrid->makeScrollable();
// create the datagrid columns
$code = new TDataGridColumn('code', 'Code', 'right', 70);
$name = new TDataGridColumn('name', 'Name', 'left', 180);
$address = new TDataGridColumn('address', 'Address', 'left', 180);
$telephone = new TDataGridColumn('fone', 'Phone', 'left', 160);
// add the columns to the datagrid
$this->datagrid->addColumn($code);
$this->datagrid->addColumn($name);
$this->datagrid->addColumn($address);
$this->datagrid->addColumn($telephone);
// creates the datagrid model
$this->datagrid->createModel();
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->datagrid);
parent::add($vbox);
}
示例3: BootstrapFormWrapper
/**
* 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);
}
示例4: TForm
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
$this->form = new TForm();
$list1 = new TSortList('list1');
$list2 = new TSortList('list2');
$list1->addItems(array('1' => 'One', '2' => 'Two', '3' => 'Three'));
$list2->addItems(array('a' => 'A', 'b' => 'B', 'c' => 'C'));
$list1->setSize(200, 100);
$list2->setSize(200, 100);
$list1->connectTo($list2);
$list2->connectTo($list1);
// creates the action button
$button1 = new TButton('action1');
$button1->setAction(new TAction(array($this, 'onSave')), 'Save');
$button1->setImage('ico_save.png');
$table = new TTable();
$row = $table->addRow();
$row->addCell($list1);
$row->addCell($list2);
$table->addRow()->addCell($button1);
$this->form->setFields(array($list1, $list2, $button1));
$this->form->add($table);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例5: TQuickForm
function __construct()
{
parent::__construct();
// create the form using TQuickForm class
$this->form = new TQuickForm();
$this->form->class = 'tform';
$this->form->setFormTitle('Formas de Pagamentos');
$combo = new TCombo('pagamento');
$combo_items = array();
$combo_items['a'] = 'Cartão de Crédito Visa';
$combo_items['b'] = 'Cartão de Crédito Mastercard';
$combo_items['c'] = 'Ticket Vale Refeição';
$combo_items['d'] = 'PagSeguro';
$combo_items['e'] = 'PayPal';
$combo_items['f'] = 'DriverCoins';
$combo->addItems($combo_items);
$this->form->addQuickField('Forma de Pagamentos', $combo, 500);
$this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png');
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->style = 'width: 100%';
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例6: TNotebook
/**
* 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);
}
示例7: __construct
public function __construct()
{
parent::__construct();
// show the message dialog
new TMessage('error', 'Error message');
parent::add(new TXMLBreadCrumb('menu.xml', __CLASS__));
}
示例8: __construct
/**
* Constructor method
*/
public function __construct()
{
parent::__construct();
// load the styles
TPage::include_css('app/resources/styles.css');
// define two actions
$action1 = new TAction(array($this, 'onAction1'));
$action2 = new TAction(array($this, 'onAction2'));
// create a quick form with two action buttons
$form = new TQuickForm();
$form->addQuickAction('Action 1', $action1, 'ico_view.png');
$form->addQuickAction('Action 2', $action2, 'ico_view.png');
try {
// create the HTML Renderer
$this->html = new THtmlRenderer('app/resources/content.html');
// define replacements for the main section
$replace = array();
$replace['name'] = 'Test name';
$replace['address'] = 'Test address';
// replace the main section variables
$this->html->enableSection('main', $replace);
// Table wrapper (form and HTML)
$table = new TTable();
$table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__));
$table->addRow()->addCell($form);
$table->addRow()->addCell($this->html);
parent::add($table);
} catch (Exception $e) {
new TMessage('error', $e->getMessage());
}
}
示例9: TQuickForm
/**
* 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);
}
示例10: __construct
public function __construct()
{
parent::__construct();
$this->form = new TForm();
// creates one datagrid
$this->datagrid = new TQuickGrid();
$this->datagrid->disableDefaultClick();
// important!
$this->form->add($this->datagrid);
// add the columns
$this->datagrid->addQuickColumn('Check', 'check', 'right', 40);
$this->datagrid->addQuickColumn('Code', 'code', 'right', 70);
$this->datagrid->addQuickColumn('Name', 'name', 'left', 180);
$this->datagrid->addQuickColumn('Address', 'address', 'left', 180);
$this->datagrid->addQuickColumn('Phone', 'fone', 'left', 120);
// creates the datagrid model
$this->datagrid->createModel();
// creates the action button
$button1 = new TButton('action1');
// define the button action
$button1->setAction(new TAction(array($this, 'onSave')), 'Save');
$button1->setImage('ico_save.png');
$this->form->addField($button1);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
$vbox->add($button1);
parent::add($vbox);
}
示例11: __construct
public function __construct()
{
parent::__construct();
// instancia objeto DataGrid
$this->datagrid = new TDataGrid();
// instancia as colunas da DataGrid
$codigo = new TDataGridColumn('codigo', 'Código', 'left', 50);
$nome = new TDataGridColumn('nome', 'Nome', 'left', 180);
$endereco = new TDataGridColumn('endereco', 'Endereço', 'left', 140);
$telefone = new TDataGridColumn('fone', 'Fone', 'center', 100);
// adiciona as colunas à DataGrid
$this->datagrid->addColumn($codigo);
$this->datagrid->addColumn($nome);
$this->datagrid->addColumn($endereco);
$this->datagrid->addColumn($telefone);
// instancia duas ações da DataGrid
$action1 = new TDataGridAction(array($this, 'onDelete'));
$action1->setLabel('Deletar');
$action1->setImage('ico_delete.png');
$action1->setField('codigo');
$action2 = new TDataGridAction(array($this, 'onView'));
$action2->setLabel('Visualizar');
$action2->setImage('ico_view.png');
$action2->setField('nome');
// adiciona as ações à DataGrid
$this->datagrid->addAction($action1);
$this->datagrid->addAction($action2);
// cria o modelo da DataGrid, montando sua estrutura
$this->datagrid->createModel();
// adiciona a DataGrid à página
parent::add($this->datagrid);
}
示例12: TTable
/**
* 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);
}
示例13: __construct
public function __construct()
{
parent::__construct();
$this->form = new TQuickForm('sqlpanel');
$this->form->class = 'tform';
$this->form->setFormTitle('SQL Panel');
$this->form->style = 'width:100%';
$list = scandir('app/config');
$options = array();
foreach ($list as $entry) {
if (substr($entry, -4) == '.ini') {
$options[substr($entry, 0, -4)] = $entry;
}
}
$database = new TCombo('database');
$select = new TText('select');
$database->addItems($options);
$this->form->addQuickField(_t('Database'), $database, '50%', new TRequiredValidator());
$this->form->addQuickField('SELECT', $select, '80%', new TRequiredValidator());
$this->form->addQuickAction(_t('Generate'), new TAction(array($this, 'onGenerate')), 'fa:check-circle green');
$select->setSize('80%', 100);
$this->container = new TTable();
$this->container->style = 'width: 80%';
$this->container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemProgramList'));
$this->container->addRow()->addCell($this->form);
parent::add($this->container);
}
示例14: TForm
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_Customer');
try {
// UIBuilder object
$ui = new TUIBuilder(500, 340);
$ui->setController($this);
$ui->setForm($this->form);
// reads the xml form
$ui->parseFile('app/forms/customerlist.form.xml');
$this->datagrid = $ui->getWidget('datagrid1');
$this->pageNavigation = $this->datagrid->getPageNavigation();
$this->form->add($ui);
$this->form->setFields($ui->getFields());
} catch (Exception $e) {
new TMessage('error', $e->getMessage());
}
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例15: TQuickForm
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// create the form using TQuickForm class
$this->form = new TQuickForm('form_dynamic_filter');
// create the notebook
$notebook = new TNotebook(530, 160);
// adds the notebook page
$notebook->appendPage('Dynamic filtering', $this->form);
$check_gender = new TCheckGroup('check_gender');
$check_gender->addItems(array('M' => 'Male', 'F' => 'Female'));
$check_gender->setLayout('horizontal');
$combo_status = new TCombo('combo_status');
$combo_status->addItems(array('S' => 'Single', 'C' => 'Committed', 'M' => 'Married'));
$combo_customers = new TCombo('customers');
// add the fields inside the form
$this->form->addQuickField('Load customers: ', $check_gender, 200);
$this->form->addQuickField('', $combo_status, 200);
$this->form->addQuickField('', $combo_customers, 200);
$check_gender->setChangeAction(new TAction(array($this, 'onGenderChange')));
$combo_status->setChangeAction(new TAction(array($this, 'onGenderChange')));
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($notebook);
parent::add($vbox);
}