1 | <?php |
||
15 | class LabelColumn extends DataColumn |
||
16 | { |
||
17 | /** |
||
18 | * @var array $labels the configuration on how to display the different label values. Each array element key |
||
19 | * represents a label value which can be specified as a string or an array of the following structure: |
||
20 | * |
||
21 | * ``` |
||
22 | * 'active' => [ |
||
23 | * 'label' => 'subscribed', // string, the status label. If not provided, the key will be used as the label. |
||
24 | * 'options' => [ |
||
25 | * 'style' => 'padding: 2px' // array, optional, the HTML attributes of the button. |
||
26 | * ] |
||
27 | * ], |
||
28 | * ``` |
||
29 | * |
||
30 | * The key names of the array will be used to match against the value. If a match is found, will render a bootstrap |
||
31 | * label with the options provided. |
||
32 | * |
||
33 | * @see http://getbootstrap.com/components/#labels |
||
34 | */ |
||
35 | public $labels = []; |
||
36 | /** |
||
37 | * @var string forcely set the format to HTML. |
||
38 | */ |
||
39 | public $format = 'html'; |
||
40 | |||
41 | /** |
||
42 | * @inheritdoc |
||
43 | */ |
||
44 | public function getDataCellValue($model, $key, $index) |
||
59 | } |
||
60 |