Forum


Replies: 14   Views: 4203
Table of contents before variables.
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by jordyboytjuh  · 30-01-2015 - 09:37

Hello admin, I don't really understand where I put my page break and section. I've two variables on the first page. And twho on the third page. Between them I want a table of contents, which is updated automatically. My code right now: $variables = array( 'TITLE' => 'Document', 'SUBTITLE' => 'Description', ); $docx->replaceVariableByText($variables); $docx->addBreak(array('type' => 'page')); $docx->addSection('nextPage', 'A4'); //Add table of contents to the document $docx->addTableContents(array('autoUpdate' => true)); $docx->addBreak(array('type' => 'page')); $docx->addSection('nextPage', 'A4'); $variables = array( 'PART1' => 'title', 'PART2' => 'description' ); //etc. My template is just as how I want it, on the first page there are 2 variables. Then 1 page blank and then 1 page with 2 variables again. The table of contents has to be on page 2. Can you help me? Thanks a lot! Regards