@@ -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""""""""""
@@ -127,7 +132,7 @@ Given a template containing
127132 This block content will be replaced
128133 ${/block_name}
129134
130- The following will replace everything between``${block_name}`` and ``${/block_name} `` with the value passed.
135+ The following will replace everything between ``${block_name} `` and ``${/block_name} `` with the value passed.
131136
132137.. code-block :: php
133138
@@ -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,3 +249,31 @@ 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);
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+
264+ save
265+ """"
266+ Saves the loaded template within the current directory. Returns the file path.
267+
268+ .. code-block :: php
269+
270+ $filepath = $templateProcessor->save();
271+
272+ saveAs
273+ """"""
274+ Saves a copy of the loaded template in the indicated path.
275+
276+ .. code-block :: php
277+
278+ $pathToSave = 'path/to/save/file.ext';
279+ $templateProcessor->saveAs($pathToSave);
0 commit comments