Example #1
0
 /**
  * Renders the header rows for the table
  *
  * @param Table $table
  *
  * @return array
  */
 protected function buildHeaders(Table $table)
 {
     //Generate each row
     $rows = array();
     foreach ($table->getHeaderRows() as $row) {
         //Build the cells for each row
         $cells = array();
         foreach ($row as $cell) {
             $cells[] = $this->headerCell($cell);
         }
         $rows[] = $this->headerRow($row, $cells);
     }
     return $rows;
 }
Example #2
0
 /**
  * @covers Fuel\Common\Table::createRow
  * @covers Fuel\Common\Table::addRow
  * @covers Fuel\Common\Table::getHeaderRows
  * @group Common
  */
 public function testAddHeader()
 {
     $this->object->createRow(Table\EnumRowType::Header)->addRow();
     $this->assertEquals(1, count($this->object->getHeaderRows()));
 }