Skip to content

Commit d90be5d

Browse files
authored
Update list.md
1 parent 9fb20fc commit d90be5d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

docs/usage/styles/list.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,30 @@
33
``` php
44
<?php
55

6-
use PhpOffice\PhpWord\Style\ListItem as ListStyle;
7-
$listStyle = ['listType' => ListStyle::TYPE_NUMBER_NESTED];
8-
$section->addListItem('List Item 1', 0, null, $listStyle);
6+
$numStyle = 'decimal';
7+
$phpWord->addNumberingStyle($numStyle, ['type' => 'singleLevel', 'levels' => [
8+
['format' => 'decimal', 'text' => '%1.', 'left' => 360, 'hanging' => 360, 'tabPos' => 360],
9+
]]);
10+
$section->addListItem('List Item 1', 0, null, $numStyle);
911
```
1012

1113
See [`Sample_14_ListItem`](/samples/Sample_14_ListItem.php) for more code samples.
1214

13-
## Constants
15+
## Options
16+
- `numStyle`. Numbering style name. If no name is provided, a bullet list will be returned.
17+
* See [`Styles > Numbering`](../styles/numbering.md) for possible values.
18+
19+
## DEPRECATED Constants
1420
- `TYPE_SQUARE_FILLED`.
1521
- `TYPE_BULLET_FILLED`.
1622
- `TYPE_BULLET_EMPTY`.
1723
- `TYPE_NUMBER`.
1824
- `TYPE_NUMBER_NESTED`. L1: 1., L2: 1.1., L3: 1.1.1. etc.
1925
- `TYPE_ALPHANUM`. L1: Decimal, L2: LowerLetter, L3: LowerRoman repeat.
2026

21-
## Options
27+
## DEPRECATED Options
2228
- `listType`. Predefined numbering styles.
2329
* See constants above for possible values.
24-
- `numStyle`.
25-
* See [`Styles > Numbering`](../styles/numbering.md) for possible values.
2630

2731
## Used In
2832
- [`Element > ListItem`](../elements/list.md).

0 commit comments

Comments
 (0)