PHPRtfLite_Table::getCell PHP Méthode

getCell() public méthode

gets the instance of cell
public getCell ( integer $rowIndex, integer $columnIndex ) : PHPRtfLite_Table_Cell
$rowIndex integer
$columnIndex integer
Résultat PHPRtfLite_Table_Cell
    public function getCell($rowIndex, $columnIndex)
    {
        if ($this->checkIfCellExists($rowIndex, $columnIndex)) {
            return $this->getRow($rowIndex)->getCellByIndex($columnIndex);
        }
        throw new PHPRtfLite_Exception('Wrong index for cell! You gave me: (row:' . $rowIndex . ', column:' . $columnIndex . ')');
    }

Usage Example

Exemple #1
0
 /**
  * tests setBorder on cell 2x2
  * @depends testSetBorderForCellWithRow2Column1
  *
  * @param  PHPRtfLite_Table $table
  */
 public function testSetBorderForCellWithRow2Column2(PHPRtfLite_Table $table)
 {
     $border = new PHPRtfLite_Border($table->getRtf());
     $border->setBorders(new PHPRtfLite_Border_Format(1, '#888'));
     $cell2x2 = $table->getCell(2, 2);
     $cell1x2 = $table->getCell(1, 2);
     $cell2x1 = $table->getCell(2, 1);
     $cell2x2->setBorder($border);
     $this->assertEquals('#3F3', $cell1x2->getBorder()->getBorderTop()->getColor());
     $this->assertEquals('#888', $cell1x2->getBorder()->getBorderBottom()->getColor());
     $this->assertEquals('#888', $cell2x1->getBorder()->getBorderRight()->getColor());
 }
All Usage Examples Of PHPRtfLite_Table::getCell