Home > Software design >  i extend class want exten contructor laravel. php
i extend class want exten contructor laravel. php

Time:10-29

i extend class want exten contructor laravel. php i extend class want exten contructor laravel. i extend class want exten contructor laravel. contructor class children

function __construct($documentTemplate) {
        parent::__construct();
    }

Contructor class parent...i extend class want exten contructor laravel.....i extend class want exten contructor laravel....i extend class want exten contructor 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());
    }

See screenshot for error message

CodePudding user response:

You have to pass the param to parent::__construct(); in your extend class.

So that:

function __construct($documentTemplate) {
    parent::__construct($documentTemplate);
}
  • Related