-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Labels
Description
Describe the problem
I think it would be useful to add something like
$header->addPreserveText("{AUTHOR}");
or
$header->addField('AUTHOR')
this way the field will auto adapt if the user change the author of the word file
Describe the expected behavior
i tried to edit the PhpWord/Writer/Word2007/Element/Field.php
:
private function writeAuthor(ElementField $element): void
{
$xmlWriter = $this->getXmlWriter();
$xmlWriter->startElement('w:fldSimple');
$xmlWriter->writeAttribute('w:instr', 'AUTHOR');
$xmlWriter->endElement(); // w:fldSimple
}
and in PhpWord/element/Field.php
:
protected $fieldsArray = [
'AUTHOR' => [ ],
...
];
Priority
- I want to crowdfund the feature (with @algora-io) and fund a community developer.
- I want to pay the feature and fund a maintainer for that. (Contact @Progi1984)