Exemple #1
0
 function test()
 {
     $tableRow = new TableRow();
     $cell = new TableCell();
     $tableRow->addChild($cell);
     $html = $tableRow->render();
     // select_ok('tr td',1,$html);
 }
Exemple #2
0
 /**
  * Add elements to a new row
  *
  *      $table->addRow( $element1, $element2 , $element3 );
  *      $table->addRow( array( $element1, $element2 , $element3 ) );
  *
  * @return TableRow
  */
 public function addRow($rows = null)
 {
     if (!is_array($rows)) {
         $rows = func_get_args();
     }
     $row = new TableRow();
     foreach ($rows as $arg) {
         $cell = new TableCell();
         $cell->addChild($arg);
         $row->addChild($cell);
     }
     $this->addChild($row);
     return $row;
 }
Exemple #3
0
 /**
  * Add Widget into a new row , two cells
  */
 public function layoutWidget($widget)
 {
     $cell = new TableCell();
     $cell->align($this->labelColumnAlign);
     $cell->width($this->labelColumnWidth);
     $cell->addClass('formkit-column-label');
     if ($widget->label) {
         $cell->addChild(new Label($widget->label));
     }
     $cell2 = new TableCell();
     $cell2->align($this->widgetColumnAlign);
     $cell2->width($this->widgetColumnWidth);
     $cell2->addClass('formkit-column-widget');
     $cell2->addChild($widget);
     $row = new TableRow();
     $row->addChild($cell);
     $row->addChild($cell2);
     $this->body->addChild($row);
     return $this;
 }