Afternoon,
I am trying to achieve something like this:
Test -> AddText WF
- Foo -> AddList WF
- Foo
- Foo​
Test2
- Foo
- Foo
$event_wf = new WordFragment($phpdocx, 'document');
$paragraphOptions = array(
'lineBreak' => 'after',
'bold' => 'true',
);
$itemList = array(
'Line 1',
'Line 2',
'Line 3',
'Line 4',
'Line 5'
);
foreach ($events as $key => $value) {
$wf = new WordFragment($phpdocx, 'document');
$wf->addText($value->AccordianLabel, $paragraphOptions);
$events_array[] = $wf;
$wf_bullets = new WordFragment($phpdocx, 'document');
$wf_bullets->addList($itemList, 1);
$events_array[] = $wf_bullets;
}
$event_wf->addText($events_array);
$phpdocx->replaceVariableByWordFragment(array('DATA_EVENTS' => $event_wf));
The problem is my output is like this:
Test
FOOFOOFOOTest2
FOOFOO
So the list isn't working. Any ideas?
Thanks in advance