@@ -63,6 +63,11 @@ Example:
6363
6464 $templateProcessor->setImageValue('CompanyLogo', 'path/to/company/logo.png');
6565 $templateProcessor->setImageValue('UserLogo', array('path' => 'path/to/logo.png', 'width' => 100, 'height' => 100, 'ratio' => false));
66+ $templateProcessor->setImageValue('FeatureImage', function () {
67+ // Closure will only be executed if the replacement tag is found in the template
68+
69+ return array('path' => SlowFeatureImageGenerator::make(), 'width' => 100, 'height' => 100, 'ratio' => false);
70+ });
6671
6772 cloneBlock
6873""""""""""
@@ -190,7 +195,7 @@ Finds a row in a table row identified by `$search` param and clones it as many t
190195 ['userId' => 1, 'userName' => 'Batman', 'userAddress' => 'Gotham City'],
191196 ['userId' => 2, 'userName' => 'Superman', 'userAddress' => 'Metropolis'],
192197 ];
193- $templateProcessor->cloneRowAndSetValues('userId', );
198+ $templateProcessor->cloneRowAndSetValues('userId', $values );
194199
195200 Will result in
196201
@@ -244,17 +249,28 @@ See ``Sample_40_TemplateSetComplexValue.php`` for examples.
244249 $table->addCell(150)->addText('Cell B2');
245250 $table->addCell(150)->addText('Cell B3');
246251 $templateProcessor->setComplexBlock('table', $table);
247-
252+
253+ setChartValue
254+ """""""""""""
255+ Replace a variable by a chart.
256+
257+ .. code-block :: php
258+
259+ $categories = array('A', 'B', 'C', 'D', 'E');
260+ $series1 = array(1, 3, 2, 5, 4);
261+ $chart = new Chart('doughnut', $categories, $series1);
262+ $templateProcessor->setChartValue('myChart', $chart);
263+
248264 save
249- """""""""
265+ """"
250266Saves the loaded template within the current directory. Returns the file path.
251267
252268.. code-block :: php
253269
254270 $filepath = $templateProcessor->save();
255271
256272 saveAs
257- """""""""
273+ """"""
258274Saves a copy of the loaded template in the indicated path.
259275
260276.. code-block :: php
0 commit comments