@@ -63,6 +63,11 @@ Example:
63
63
64
64
$templateProcessor->setImageValue('CompanyLogo', 'path/to/company/logo.png');
65
65
$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
+ });
66
71
67
72
cloneBlock
68
73
""""""""""
@@ -190,7 +195,7 @@ Finds a row in a table row identified by `$search` param and clones it as many t
190
195
['userId' => 1, 'userName' => 'Batman', 'userAddress' => 'Gotham City'],
191
196
['userId' => 2, 'userName' => 'Superman', 'userAddress' => 'Metropolis'],
192
197
];
193
- $templateProcessor->cloneRowAndSetValues('userId', );
198
+ $templateProcessor->cloneRowAndSetValues('userId', $values );
194
199
195
200
Will result in
196
201
@@ -244,17 +249,28 @@ See ``Sample_40_TemplateSetComplexValue.php`` for examples.
244
249
$table->addCell(150)->addText('Cell B2');
245
250
$table->addCell(150)->addText('Cell B3');
246
251
$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
+
248
264
save
249
- """""""""
265
+ """"
250
266
Saves the loaded template within the current directory. Returns the file path.
251
267
252
268
.. code-block :: php
253
269
254
270
$filepath = $templateProcessor->save();
255
271
256
272
saveAs
257
- """""""""
273
+ """"""
258
274
Saves a copy of the loaded template in the indicated path.
259
275
260
276
.. code-block :: php
0 commit comments