Merge pull request #1539 from GautierDele/develop
Update documentation on usage of ListItemRun
This commit is contained in:
commit
56ca30ab95
|
|
@ -61,7 +61,7 @@ Legend:
|
||||||
Texts
|
Texts
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Text can be added by using ``addText`` and ``addTextRun`` method.
|
Text can be added by using ``addText`` and ``addTextRun`` methods.
|
||||||
``addText`` is used for creating simple paragraphs that only contain texts with the same style.
|
``addText`` is used for creating simple paragraphs that only contain texts with the same style.
|
||||||
``addTextRun`` is used for creating complex paragraphs that contain text with different style (some bold, other
|
``addTextRun`` is used for creating complex paragraphs that contain text with different style (some bold, other
|
||||||
italics, etc) or other elements, e.g. images or links. The syntaxes are as follow:
|
italics, etc) or other elements, e.g. images or links. The syntaxes are as follow:
|
||||||
|
|
@ -155,13 +155,18 @@ method or using the ``pageBreakBefore`` style of paragraph.
|
||||||
Lists
|
Lists
|
||||||
-----
|
-----
|
||||||
|
|
||||||
To add a list item use the function ``addListItem``.
|
Lists can be added by using ``addListItem`` and ``addListItemRun`` methods.
|
||||||
|
``addListItem`` is used for creating lists that only contain plain text.
|
||||||
|
``addListItemRun`` is used for creating complex list items that contains texts
|
||||||
|
with different style (some bold, other italics, etc) or other elements, e.g.
|
||||||
|
images or links. The syntaxes are as follow:
|
||||||
|
|
||||||
Basic usage:
|
Basic usage:
|
||||||
|
|
||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
$section->addListItem($text, [$depth], [$fontStyle], [$listStyle], [$paragraphStyle]);
|
$section->addListItem($text, [$depth], [$fontStyle], [$listStyle], [$paragraphStyle]);
|
||||||
|
$listItemRun = $section->addListItemRun([$depth], [$listStyle], [$paragraphStyle])
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
|
|
@ -172,6 +177,8 @@ Parameters:
|
||||||
TYPE\_ALPHANUM, TYPE\_BULLET\_FILLED, etc. See list of constants in PHPWord\\Style\\ListItem.
|
TYPE\_ALPHANUM, TYPE\_BULLET\_FILLED, etc. See list of constants in PHPWord\\Style\\ListItem.
|
||||||
- ``$paragraphStyle``. See :ref:`paragraph-style`.
|
- ``$paragraphStyle``. See :ref:`paragraph-style`.
|
||||||
|
|
||||||
|
See ``Sample_09_Tables.php`` for more code sample.
|
||||||
|
|
||||||
Advanced usage:
|
Advanced usage:
|
||||||
|
|
||||||
You can also create your own numbering style by changing the ``$listStyle`` parameter with the name of your numbering style.
|
You can also create your own numbering style by changing the ``$listStyle`` parameter with the name of your numbering style.
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ $section->addText('List with inline formatting.');
|
||||||
$listItemRun = $section->addListItemRun();
|
$listItemRun = $section->addListItemRun();
|
||||||
$listItemRun->addText('List item 1');
|
$listItemRun->addText('List item 1');
|
||||||
$listItemRun->addText(' in bold', array('bold' => true));
|
$listItemRun->addText(' in bold', array('bold' => true));
|
||||||
$listItemRun = $section->addListItemRun();
|
$listItemRun = $section->addListItemRun(1, $predefinedMultilevelStyle, $paragraphStyleName);
|
||||||
$listItemRun->addText('List item 2');
|
$listItemRun->addText('List item 2');
|
||||||
$listItemRun->addText(' in italic', array('italic' => true));
|
$listItemRun->addText(' in italic', array('italic' => true));
|
||||||
$footnote = $listItemRun->addFootnote();
|
$footnote = $listItemRun->addFootnote();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue