File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -235,3 +235,37 @@ if (!empty($age)) {
235235```
236236
237237This piece of code wait unit user type something on keyboard.
238+
239+ Helpers
240+ -------
241+
242+ In framework we can use helpers to generate some views.
243+
244+ ### Table
245+ Table is simple helper which generate tabular data.
246+
247+ Usage of ` table ` :
248+
249+ ``` php
250+ $table = $this->getHelper('Table');
251+ $table
252+ ->setHeaders(array('ID', 'Name', 'Surname'))
253+ ->setRows(array(
254+ array('1', 'John', 'Smith'),
255+ array('2', 'Brad', 'Pitt'),
256+ array('3', 'Denzel', 'Washington'),
257+ array('4', 'Angelina', 'Jolie')
258+ ));
259+ $table->render($this->getStdout());
260+ ```
261+
262+ will generate:
263+
264+ +----+----------+------------+
265+ | ID | Name | Surname |
266+ +----+----------+------------+
267+ | 1 | John | Smith |
268+ | 2 | Brad | Pitt |
269+ | 3 | Denzel | Washington |
270+ | 4 | Angelina | Jolie |
271+ +----+----------+------------+
You can’t perform that action at this time.
0 commit comments