Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93d4b29

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents d40196c + 834a640 commit 93d4b29

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,37 @@ if (!empty($age)) {
235235
```
236236

237237
This 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+
+----+----------+------------+

0 commit comments

Comments
 (0)