Replies: 5   Views: 1290
Issue with addtext(..) in addlist() item
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 admin  · 04-04-2017 - 06:25

Edited by admin · 04-04-2017 - 11:53


In the examples folder included in the package of the license you can find examples of how to use importListStyle, importStyles and parseStyles methods. You can find them in the examples/LayoutAndGeneral folder.

To import a list style you need to use the importListStyle method ( For example:

$docx->importListStyle('template.docx', '1', 'myliststyle');

$itemList = array(
    'Line 1',
    'Line 2',
    'Line 3',
    'Line 4',
    'Line 5'

$docx->addList($itemList, 'myliststyle');

If the style is not applied using your custom template, please check that you are setting the correct list ID.