public function __construct() { parent::__construct(); $action1 = new Action(array($this, 'executaAcao1')); $action1->setParameter('codigo', 4); $action1->setParameter('nome', 'teste'); print $action1->serialize(); }
/** * Pergunta sobre a exclusão de registro */ function onDelete($param) { $id = $param['id']; // obtém o parâmetro $id $action1 = new Action(array($this, 'Delete')); $action1->setParameter('id', $id); new Question('Deseja realmente excluir o registro?', $action1); }
public function __construct() { parent::__construct(); $button1 = new Element('a'); $button1->add('Ação 1'); $button1->class = 'btn btn-success'; $button2 = new Element('a'); $button2->add('Ação 2'); $button2->class = 'btn btn-primary'; $action1 = new Action(array($this, 'executaAcao1')); $action1->setParameter('codigo', 4); $action2 = new Action(array($this, 'executaAcao2')); $action2->setParameter('codigo', 5); $button1->href = $action1->serialize(); $button2->href = $action2->serialize(); $button1->show(); $button2->show(); }
/** * Pergunta sobre a exclusão de registro */ public function onDelete($param) { $key = $param['key']; // obtém o parâmetro $key $action1 = new Action(array($this, 'Delete')); $action1->setParameter('key', $key); new Question('Deseja realmente excluir o registro?', $action1); }