News

Nested Lists in PHPdocx

  • May 04, 2011

If you need to create a nested list (a list inside a list) is not complicated, just take a look at this code:


require_once '../../classes/CreateDocx.inc';

$docx = new CreateDocx();

// Parameters for the list
$paramsList = array(
'val' => 1
);

// values for the list
$valuesList = array(
'Line 1',
array(
'Line A',
'Line B',
'Line C'
),
'Line 2',
'Line 3',
);

// Constructing the nested list
$docx->addList($valuesList, $paramsList);

$docx->createDocx('example_list_nested');