Multiple sets of listItems ?

Jul 31, 2011 at 6:12 PM

I've got multiple sections in my document and I'm calling $section->addListItem() within each of them, using the TYPE_NUMBER bullet type.  It appears that successive calls to addListItem(), even across sections, appears to just continue the same numeric sequence.  Eg:

 

$word = new PHPWord;

$section1 = $word->createSection();

$section1->addListItem("First Item, first list", 0, 'fNormal', array('listType' => 7), 'pNormal');

$section1->addListItem("Second Item, first list", 0, 'fNormal', array('listType' => 7), 'pNormal');

$section2 = $word->createSection();

$section2->addListItem("First Item, second list", 0, 'fNormal', array('listType' => 7), 'pNormal');

$section2->addListItem("Second Item, second list", 0, 'fNormal', array('listType' => 7), 'pNormal');

 

This appears to generate:

1. First item, first list

2. Second item, first list

3. First item, second list

4. Second item, second list

 

I am hoping to achieve:

1. First item, first list

2. Second item, first list

1. First item, second list

2. Second item, second list

 

Is this possible?

Aug 1, 2011 at 4:33 PM

Add a text break between lists:

$section->addTextBreak(2);

Jul 9, 2012 at 8:13 PM

The above comment did not fix this issue.  Has anyone figured out a solution to this problem?