TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

Header on docx

By: lena
Date: 2017-01-10
Time: 14:22

Header on docx

Hi

I do not understand why tags not work in headers in DOCX. I am working with symfony. I found the advice to include plugin: $TBS->PlugIn(OPENTBS_SELECT_HEADER, [$Type[, $Offset]).
Firstly i become the mistake about brackets ($TBS->PlugIn(OPENTBS_SELECT_HEADER, [$Type[, $Offset])  - here is not closed bracket). If i make so:

$TBS->PlugIn(OPENTBS_SELECT_HEADER, [OPENTBS_EVEN]);
or
$TBS->PlugIn(OPENTBS_SELECT_HEADER, [OPENTBS_DEFAULT ]);

only tags from header are changed, other tags stay the same.  Could you advice me something?
  
                               
By: Skrol29
Date: 2017-01-10
Time: 14:25

Re: Header on docx

Hi,

Brackets are usual syntax for meaning optional arguments in a function's synopsis.
See for example: http://php.net/manual/en/function.strpos.php

The correct snippet is
$TBS->PlugIn(OPENTBS_SELECT_HEADER, OPENTBS_EVEN)
By: lena
Date: 2017-01-10
Time: 14:51

Re: Header on docx

Skrol29, thank you very much for the answer, but this does not work. I become not mistakes, but with OPENTBS_EVEN header does not work and with OPENTBS_DEFAULT other tags do not work. I can attach a document, but do not see how.
By: Skrol29
Date: 2017-01-11
Time: 09:34

Re: Header on docx

Automatic fields [onload] and [onshow] are automatically merged in headers and footers.
For other fields or blocks you have to open an header/footer, to your merge on it, then load another header/footer and do the merge on it, and so one.
You have only one current selected sub-file at a time. MergeBlock() and MergeField() are working only on the current selected sub-file.