forked from VisualAppeal/YiiBootstrap
/
EBootstrapDetailView.php
54 lines (45 loc) · 1000 Bytes
/
EBootstrapDetailView.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
Yii::import('zii.widgets.CDetailView');
/*
* Wrapper class for CDetailView
* Render the DetailView as a bootstrap table
*
* @author Tim Helfensdörfer <tim@visualappeal.de>
* @version 0.3.0
* @package bootstrap.yiiwidgets
*/
class EBootstrapDetailView extends CDetailView {
/*
* Do not include the default style
*
* If it's set unequal false the css file specified will be included
*/
public $cssFile = false;
/*
* Bordered table
*/
public $bordered = false;
/*
* Every second row has a darker background
*/
public $striped = false;
/*
* Smaller table fields to display more content
*/
public $condensed = false;
/*
* Init the widget
*/
public function init() {
parent::init();
$classes = array('table');
if ($this->bordered)
$classes[] = 'table-bordered';
if ($this->striped)
$classes[] = 'table-striped';
if ($this->condensed)
$classes[] = 'table-condensed';
EBootstrap::mergeClass($this->htmlOptions, $classes);
}
}
?>