1 <?php
2
3 namespace Grido\Components\Columns;
4
5 6 7 8 9
10 class BooleanExtension extends Text
11 {
12 public function getCellPrototype($row = NULL)
13 {
14 $cell = parent::getCellPrototype($row = NULL);
15 $cell->class[] = 'center';
16
17 return $cell;
18 }
19
20 21 22 23
24 protected function formatValue($value)
25 {
26 if(!$value) {
27 $icon = 'remove';
28 }
29 elseif ($value == 1) {
30 $icon = 'transfer';
31 }
32 else {
33 $icon = 'ok';
34 }
35
36 return \Nette\Utils\Html::el('i')->class("glyphicon glyphicon-$icon icon-$icon");
37 }
38
39 }
40
41