Word2007 extends AbstractWriter implements WriterInterface
Word2007 writer
Interfaces, Classes and Traits
- WriterInterface
- Writer interface
Table of Contents
- $mediaPaths : array<string|int, mixed>
- Paths to store media files
- $parts : array<string|int, mixed>
- Part name and file name pairs
- $phpWord : PhpWord
- PHPWord object
- $writerParts : array<string|int, mixed>
- Individual writers
- $contentTypes : array<string|int, mixed>
- Content types values
- $diskCachingDirectory : string
- Disk caching directory
- $originalFilename : string
- Original file name
- $relationships : array<string|int, mixed>
- Document relationship
- $tempDir : string
- Temporary directory
- $tempFilename : string
- Temporary file name
- $useDiskCaching : bool
- Use disk caching
- __construct() : mixed
- Create new Word2007 writer
- getContentTypes() : array<string|int, mixed>
- Get content types
- getDiskCachingDirectory() : string
- Get disk caching directory
- getPhpWord() : PhpWord
- Get PhpWord object
- getRelationships() : array<string|int, mixed>
- Get content types
- getTempDir() : string
- Get temporary directory
- getUseDiskCaching() : mixed
- Get use disk caching status
- getWriterPart() : mixed
- Get writer part
- isUseDiskCaching() : bool
- Get use disk caching status
- save() : mixed
- Save document by name.
- setPhpWord() : self
- Set PhpWord object
- setTempDir() : self
- Set temporary directory
- setUseDiskCaching() : self
- Set use disk caching status
- addFilesToPackage() : mixed
- Add files to package.
- addFileToPackage() : mixed
- Add file to package.
- cleanupTempFile() : mixed
- Cleanup temporary file.
- clearTempDir() : mixed
- Clear temporary directory.
- getTempFile() : string
- Get temporary file name
- getZipArchive() : ZipArchive
- Get ZipArchive object
- openFile() : resource
- Open file for writing
- writeFile() : mixed
- Write content to file.
- addChart() : mixed
- Add chart.
- addComments() : mixed
- Add comments
- addHeaderFooterContent() : mixed
- Add header/footer content.
- addHeaderFooterMedia() : mixed
- Add header/footer media files, e.g. footer1.xml.rels.
- addNotes() : mixed
- Add footnotes/endnotes
- deleteDir() : mixed
- Delete directory.
- registerContentTypes() : mixed
- Register content types for each media.
Properties
$mediaPaths
Paths to store media files
protected
array<string|int, mixed>
$mediaPaths
= array('image' => '', 'object' => '')
$parts
Part name and file name pairs
protected
array<string|int, mixed>
$parts
= array()
$phpWord
PHPWord object
protected
PhpWord
$phpWord
= null
$writerParts
Individual writers
protected
array<string|int, mixed>
$writerParts
= array()
$contentTypes
Content types values
private
array<string|int, mixed>
$contentTypes
= array('default' => array(), 'override' => array())
$diskCachingDirectory
Disk caching directory
private
string
$diskCachingDirectory
= './'
$originalFilename
Original file name
private
string
$originalFilename
$relationships
Document relationship
private
array<string|int, mixed>
$relationships
= array()
$tempDir
Temporary directory
private
string
$tempDir
= ''
$tempFilename
Temporary file name
private
string
$tempFilename
$useDiskCaching
Use disk caching
private
bool
$useDiskCaching
= false
Methods
__construct()
Create new Word2007 writer
public
__construct([PhpWord $phpWord = null ]) : mixed
Parameters
- $phpWord : PhpWord = null
Return values
mixed —getContentTypes()
Get content types
public
getContentTypes() : array<string|int, mixed>
Return values
array<string|int, mixed> —getDiskCachingDirectory()
Get disk caching directory
public
getDiskCachingDirectory() : string
Return values
string —getPhpWord()
Get PhpWord object
public
getPhpWord() : PhpWord
Tags
Return values
PhpWord —getRelationships()
Get content types
public
getRelationships() : array<string|int, mixed>
Return values
array<string|int, mixed> —getTempDir()
Get temporary directory
public
getTempDir() : string
Return values
string —getUseDiskCaching()
Get use disk caching status
public
getUseDiskCaching() : mixed
Tags
Return values
mixed —getWriterPart()
Get writer part
public
getWriterPart([string $partName = '' ]) : mixed
Parameters
- $partName : string = ''
-
Writer part name
Return values
mixed —isUseDiskCaching()
Get use disk caching status
public
isUseDiskCaching() : bool
Return values
bool —save()
Save document by name.
public
save([string $filename = null ]) : mixed
Parameters
- $filename : string = null
Return values
mixed —setPhpWord()
Set PhpWord object
public
setPhpWord([PhpWord $phpWord = null ]) : self
Parameters
- $phpWord : PhpWord = null
Return values
self —setTempDir()
Set temporary directory
public
setTempDir(string $value) : self
Parameters
- $value : string
Return values
self —setUseDiskCaching()
Set use disk caching status
public
setUseDiskCaching([bool $value = false ][, string $directory = null ]) : self
Parameters
- $value : bool = false
- $directory : string = null
Tags
Return values
self —addFilesToPackage()
Add files to package.
protected
addFilesToPackage(ZipArchive $zip, mixed $elements) : mixed
Parameters
- $zip : ZipArchive
- $elements : mixed
Return values
mixed —addFileToPackage()
Add file to package.
protected
addFileToPackage(ZipArchive $zipPackage, string $source, string $target) : mixed
Get the actual source from an archive image.
Parameters
- $zipPackage : ZipArchive
- $source : string
- $target : string
Return values
mixed —cleanupTempFile()
Cleanup temporary file.
protected
cleanupTempFile() : mixed
Tags
Return values
mixed —clearTempDir()
Clear temporary directory.
protected
clearTempDir() : mixed
Return values
mixed —getTempFile()
Get temporary file name
protected
getTempFile(string $filename) : string
If $filename is php://output or php://stdout, make it a temporary file
Parameters
- $filename : string
Return values
string —getZipArchive()
Get ZipArchive object
protected
getZipArchive(string $filename) : ZipArchive
Parameters
- $filename : string
Tags
Return values
ZipArchive —openFile()
Open file for writing
protected
openFile(string $filename) : resource
Parameters
- $filename : string
Tags
Return values
resource —writeFile()
Write content to file.
protected
writeFile(resource $fileHandle, string $content) : mixed
Parameters
- $fileHandle : resource
- $content : string
Tags
Return values
mixed —addChart()
Add chart.
private
addChart(ZipArchive $zip, int &$rId) : mixed
Parameters
- $zip : ZipArchive
- $rId : int
Return values
mixed —addComments()
Add comments
private
addComments(ZipArchive $zip, int &$rId) : mixed
Parameters
- $zip : ZipArchive
- $rId : int
Return values
mixed —addHeaderFooterContent()
Add header/footer content.
private
addHeaderFooterContent(Section &$section, ZipArchive $zip, string $elmType, int &$rId) : mixed
Parameters
- $section : Section
- $zip : ZipArchive
- $elmType : string
-
header|footer
- $rId : int
Return values
mixed —addHeaderFooterMedia()
Add header/footer media files, e.g. footer1.xml.rels.
private
addHeaderFooterMedia(ZipArchive $zip, string $docPart) : mixed
Parameters
- $zip : ZipArchive
- $docPart : string
Return values
mixed —addNotes()
Add footnotes/endnotes
private
addNotes(ZipArchive $zip, int &$rId[, string $noteType = 'footnote' ]) : mixed
Parameters
- $zip : ZipArchive
- $rId : int
- $noteType : string = 'footnote'
Return values
mixed —deleteDir()
Delete directory.
private
deleteDir(string $dir) : mixed
Parameters
- $dir : string
Return values
mixed —registerContentTypes()
Register content types for each media.
private
registerContentTypes(array<string|int, mixed> $media) : mixed
Parameters
- $media : array<string|int, mixed>