Skip to content

Commit e7c9fa5

Browse files
Added an example to help out users to set variables
Shows users how to specify view variables by using (extended) method from ZF2's ViewModel.
1 parent c479871 commit e7c9fa5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,16 @@ class ReportController extends AbstractActionController
5454
$pdf->setOption('filename', 'monthly-report'), // Triggers PDF download, automatically appends ".pdf"
5555
$pdf->setOption('paperSize', 'a4'); // Defaults to "8x11"
5656
$pdf->setOption('paperOrientation', 'landscape'); // Defaults to "portrait"
57-
57+
58+
// To set view variables
59+
$pdf->setVariables(array(
60+
'message' => 'Hello'
61+
));
62+
5863
return $pdf;
5964
}
6065
}
6166
```
6267

6368
## To-do
64-
- Add command line support.
69+
- Add command line support.

0 commit comments

Comments
 (0)