Hello,
You can generate an array of contents to add inline contents in the same paragraph (using WordFragments and text contents).
For example, to add a checkbox and a text content:
$docx = new CreateDocx();
$checkboxFragment = new WordFragment($docx);
$checkboxOptions = array('fontSize' => 12, 'defaultValue' => true);
$checkboxFragment->addFormElement('checkbox', $checkboxOptions);
$text = array();
$text[] = $checkboxFragment;
$text[] = array(
'text' => ' A checkbox',
'bold' => true,
);
$docx->addText($text);
$docx->createDocx('output.docx');
In addition to this sample, we recommend you check the following:
- examples/Core/addText/sample_3.php included in the package
- WordFragments and WordML
- Adding more than one content into a single WordFragment as inline elements
- Adding more than one content into a single WordFragment as block elements
If you need further support about this task we can generate a more sophisticated example.
Regards.