我在Laravel 4.2中使用PHPExcel 1.8.0库。它一直工作到现在,但现在我突然得到这个错误。
'在/var/www/myfilerunner/vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php中调用未定义的方法PHPExcel :: sheetCodeNameExists()'
这是我在Worksheet.php中的代码
if($ this-> getParent()){
if ($this->getParent()->sheetCodeNameExists($pValue)) {
if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) {
$pValue = PHPExcel_Shared_String::Substring($pValue,0,29);
}
$i = 1;
while ($this->getParent()->sheetCodeNameExists($pValue . '_' . $i)) {
++$i;
if ($i == 10) {
if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) {
$pValue = PHPExcel_Shared_String::Substring($pValue,0,28);
}
} elseif ($i == 100) {
if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) {
$pValue = PHPExcel_Shared_String::Substring($pValue,0,27);
}
}
}
$pValue = $pValue . '_' . $i;// ok, we have a valid name
>setTitle($altTitle,$updateFormulaCellReferences);
}
}
我没有更改任何版本,这个方法存在于我的PHPExcel.php中。请帮帮我。