您必須使用phpexcel庫創建excel導出。所以我複製庫在我的課,然後寫了下面的代碼在我的控制器從上下文調用私人PHPExcel_IOFactory :: __構造() - TYPO3
require_once PATH_site . 'typo3conf/ext/extension_name/Classes/Library/PHPExcel/IOFactory.php';
public function excelTest()
{
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
$objReader = $objectManager->get('PHPExcel_IOFactory');
}
但它返回一個錯誤
Fatal error: Call to private PHPExcel_IOFactory::__construct() from context 'TYPO3\CMS\Core\Utility\GeneralUtility' in /opt/lampp_repository/lampp-5.6/htdocs/typo3_src-7.6.6/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 4533
非常感謝您的回答。我將其更名爲temp文件夾。十問題已解決。 –