【发布时间】:2021-12-13 09:51:37
【问题描述】:
我扩展类想要扩展构造器 laravel。 php 我扩展类想要扩展构造函数 laravel。 我扩展类想要扩展构造器 laravel。 构造器类的孩子
function __construct($documentTemplate) {
parent::__construct();
}
构造器类父...我扩展类想要扩展构造器laravel.....我扩展类想要扩展构造器laravel....我扩展类想要扩展构造器laravel。
public function __construct($documentTemplate)
{
// Temporary document filename initialization
$this->tempDocumentFilename = tempnam(Settings::getTempDir(), 'PhpWord');
if (false === $this->tempDocumentFilename) {
throw new CreateTemporaryFileException(); // @codeCoverageIgnore
}
// Template file cloning
if (false === copy($documentTemplate, $this->tempDocumentFilename)) {
throw new CopyFileException($documentTemplate, $this->tempDocumentFilename); // @codeCoverageIgnore
}
// Temporary document content extraction
$this->zipClass = new ZipArchive();
$this->zipClass->open($this->tempDocumentFilename);
$index = 1;
while (false !== $this->zipClass->locateName($this->getHeaderName($index))) {
$this->tempDocumentHeaders[$index] = $this->readPartWithRels($this->getHeaderName($index));
$index++;
}
$index = 1;
while (false !== $this->zipClass->locateName($this->getFooterName($index))) {
$this->tempDocumentFooters[$index] = $this->readPartWithRels($this->getFooterName($index));
$index++;
}
$this->tempDocumentMainPart = $this->readPartWithRels($this->getMainPartName());
$this->tempDocumentSettingsPart = $this->readPartWithRels($this->getSettingsPartName());
$this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());
}
【问题讨论】:
-
如果问题编辑器要求你写更多的文字,这意味着提供更多信息,而不是多次复制和粘贴相同(不清楚)的东西!请阅读How to Ask。
标签: php laravel error-handling