1. Go to this page and download the library: Download sgrigorjev/adf-tools library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$document = (new Document())
->append(
(new BulletList())
->append(
(new ListItem())
->append(
(new Paragraph())
->append(new Text('item 1'))
),
(new ListItem())
->append(
(new Paragraph())
->append(new Text('item 2'))
)
)
)
;
$paragraph = (new Paragraph())->append(new Text('Line 1'));
if (some condition) {
$paragraph->append(new Text('(doc)', new Link('https://example.com/doc')));
}
$document = (new Document())->append($paragraph);