PHPWord - multiple lists on a page, restarting numbering?

Soldato
Joined
26 Aug 2006
Posts
9,726
Location
62.156684,-49.781113
I realise this might be a long shot, but has anyone used PHPWord (https://phpword.codeplex.com/) or might otherwise be some kind of wizard and point me in the right direction on this...?

I'm creating a document that will contain multiple numbered lists on a page and have created two list definitions as this:

Code:
  ${'references_' . $testcase} = array('listType'=>PHPWord_Style_ListItem::TYPE_NUMBER_NESTED);
  ${'procedure_' . $testcase} = array('listType'=>PHPWord_Style_ListItem::TYPE_NUMBER_NESTED);

They're then being called within loops to add to the lists:

Code:
for ($i = 1; $i <= 10; $i++) {
  $body->addListItem('List Item ' . $i, 0, null, ${'references_' . $testcase});
}
for ($j = 1; $j <= 10; $j++) {
  $body->addListItem('List Item ' . $j, 0, null, ${'procedure_' . $testcase});
}

However, the second list numbering starts at 11 - how can I have this set back to 1?

It seems as though not even adding a section restarts the numbering?!

Actually - someone else has reported it and nothing was forthcoming: https://phpword.codeplex.com/discussions/267216 - surely people have the need for multiple lists in their documents!
 
Back
Top Bottom