Skip to content

Commit d862b1f

Browse files
committed
update documentation
1 parent 67f3bd3 commit d862b1f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/templates-processing.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,32 @@ Applies the XSL stylesheet passed to header part, footer part and main part
215215
$xslDomDocument = new \DOMDocument();
216216
$xslDomDocument->load('/path/to/my/stylesheet.xsl');
217217
$templateProcessor->applyXslStyleSheet($xslDomDocument);
218+
219+
setComplexValue
220+
"""""""""""""""
221+
Raplaces a ${macro} with the ComplexType passed.
222+
See ``Sample_40_TemplateSetComplexValue.php`` for examples.
223+
224+
.. code-block:: php
225+
226+
$inline = new TextRun();
227+
$inline->addText('by a red italic text', array('italic' => true, 'color' => 'red'));
228+
$templateProcessor->setComplexValue('inline', $inline);
229+
230+
setComplexBlock
231+
"""""""""""""""
232+
Raplaces a ${macro} with the ComplexType passed.
233+
See ``Sample_40_TemplateSetComplexValue.php`` for examples.
234+
235+
.. code-block:: php
236+
237+
$table = new Table(array('borderSize' => 12, 'borderColor' => 'green', 'width' => 6000, 'unit' => TblWidth::TWIP));
238+
$table->addRow();
239+
$table->addCell(150)->addText('Cell A1');
240+
$table->addCell(150)->addText('Cell A2');
241+
$table->addCell(150)->addText('Cell A3');
242+
$table->addRow();
243+
$table->addCell(150)->addText('Cell B1');
244+
$table->addCell(150)->addText('Cell B2');
245+
$table->addCell(150)->addText('Cell B3');
246+
$templateProcessor->setComplexBlock('table', $table);

0 commit comments

Comments
 (0)