1 <?php
2
3 namespace Grido\Components\Columns;
4
5 /**
6 * Boolean column.
7 *
8 * @author Pavel Kryštůfek (http://www.krystufkovi.cz)
9 */
10 class Boolean 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 * @param $value
22 * @return \Nette\Utils\Html
23 */
24 protected function formatValue($value)
25 {
26 $icon = $value ? 'ok' : 'remove';
27 return \Nette\Utils\Html::el('i')->class("glyphicon glyphicon-$icon icon-$icon");
28 }
29
30 }
31