0
这几天我从PHP演示开始。我加载演示文稿并尝试从单元格中删除值。但是没有清除细胞的功能。我刚发现addText()
和createText()
。如何通过PhpPresentation从表格中的单元格中删除文本?
public function modTable($slide = null){
$shapes = $slide->getShapeCollection();
foreach($shapes as $shape){
if(get_class($shape) == "PhpOffice\\PhpPresentation\\Shape\\Table") {
if($shape->getName()){
$shape->getRow(1)->getCell(0)->createTextRun("-TEST1-");
$shape->getRow(1)->getCell(0)->getParagraph(0)->createText("-TEST2-");
}
}
}
}