EG
Criar Action Botão
Pessoal, gostaria de um ajuda, criei a página abaixo com alguns botões , mas não estou conseguindo criar uma ação para os botões, abaixo o codigo e se alguem puder me informar como fazer, fico grato.
- <?php
- class Inicial extends TPage
- {
- public function __construct()
- {
- parent::__construct();
- parent::include_css('app/resources/myframe.css');
-
-
- $vbox = new TVBox;
-
- $bt3a = new TButton('bt3a');
-
- // criar uma action para $bt3a onde ao clicar chama uma função com nome por exemplo exbirTela
-
- $bt3b = new TButton('bt3b');
- $bt3c = new TButton('bt3c');
- $bt3d = new TButton('bt3d');
- $bt3e = new TButton('bt3e');
- $bt3f = new TButton('bt3f');
-
-
- $bt3a->setLabel('ORDEM DE SERVIÇO');
- $bt3b->setLabel('PDV');
- $bt3c->setLabel('CTO RECEBER');
- $bt3d->setLabel('CTO PAGAR');
- $bt3e->setLabel('CLIENTE');
- $bt3f->setLabel('PRODUTO');
-
- $bt3a->class = 'btn btn-primary btn-md';
- $bt3b->class = 'btn btn-info btn-md';
- $bt3c->class = 'btn btn-success btn-md';
- $bt3d->class = 'btn btn-danger btn-md';
- $bt3e->class = 'btn btn-success btn-md';
- $bt3f->class = 'btn btn-warning btn-md';
-
-
-
- $hbox3 = new THBox;
- $hbox3->addRowSet( $bt3e,' ',$bt3f,' ',$bt3b,' ', $bt3a,' ', $bt3c,' ',$bt3d );
- $frame3 = new TFrame;
- //$frame3->setLegend('Bootstrap styles and sizes');
- $frame3->add($hbox3);
-
- $fc = new TFullCalendar('2018-01-26','month');
- $fc->addEvent(1,'Busca Notebook','2018-01-26T10:00:00','2018-01-26T11:00:00',null,'crimson');
- $fc->addEvent(1,'Entregar Impressora','2018-01-26T13:00:00','2018-01-26T13:30:00',null,'DarkOrange');
- $fc->addEvent(1,'Receber Cliente X','2018-01-26T14:00:00','2018-01-26T14:30:00',null,'Green');
- $hbox4 = new THBox;
- $hbox4->addRowSet($fc);
- $frame4 = new TFrame;
- $frame4->add($hbox4);
-
- $vbox->add($frame3);
- $vbox->add($frame4);
-
-
- parent::add($vbox);
- }
- public function onExitCodprod1($param)
- {
- new TMessage('info', 'Information message');
-
- }
-
- }
Para adicionar uma ação a um botão você precisa de um formulário.
Caso você não precise de um formulário sugiro usar TActionLink para isso:
adianti.com.br/framework_files/tutor/index.php?class=TextLinkView