コード例 #1
0
 /**
  * método show()
  * exibe o widget na tela
  */
 public function show()
 {
     if ($this->items) {
         // percorre cada uma das opções do rádio
         foreach ($this->items as $index => $label) {
             $button = new TCheckButton("{$this->name}[]");
             $button->setValue($index);
             // verifica se deve ser marcado
             if (@in_array($index, $this->value)) {
                 $button->setProperty('checked', '1');
             }
             $button->show();
             $obj = new TLabel($label);
             $obj->show();
             if ($this->layout == 'vertical') {
                 // exibe uma tag de quebra de linha
                 $br = new TElement('br');
                 $br->show();
                 echo "\n";
             }
         }
     }
 }