| @@ 15-35 (lines=21) @@ | ||
| 12 | ||
| 13 | use hipanel\widgets\Box; |
|
| 14 | ||
| 15 | class BoxedDetailView extends DetailView |
|
| 16 | { |
|
| 17 | public $boxed = true; |
|
| 18 | /** |
|
| 19 | * To grid options, for example, you may add something like this for customize boxes: |
|
| 20 | * 'boxOptions' => ['options' => ['class' => 'box-primary']],. |
|
| 21 | * @var array |
|
| 22 | */ |
|
| 23 | public $boxOptions = []; |
|
| 24 | ||
| 25 | public function run() |
|
| 26 | { |
|
| 27 | if ($this->boxed) { |
|
| 28 | Box::begin($this->boxOptions); |
|
| 29 | echo parent::run(); |
|
| 30 | Box::end(); |
|
| 31 | } else { |
|
| 32 | return parent::run(); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| @@ 15-38 (lines=24) @@ | ||
| 12 | ||
| 13 | use hipanel\widgets\Box; |
|
| 14 | ||
| 15 | class BoxedGridView extends GridView |
|
| 16 | { |
|
| 17 | public $boxed = true; |
|
| 18 | ||
| 19 | public $detailViewClass = BoxedDetailView::class; |
|
| 20 | ||
| 21 | /** |
|
| 22 | * To grid options, for example, you may add something like this for customize boxes: |
|
| 23 | * 'boxOptions' => ['options' => ['class' => 'box-primary']],. |
|
| 24 | * @var array |
|
| 25 | */ |
|
| 26 | public $boxOptions = []; |
|
| 27 | ||
| 28 | public function run() |
|
| 29 | { |
|
| 30 | if ($this->boxed) { |
|
| 31 | Box::begin($this->boxOptions); |
|
| 32 | parent::run(); |
|
| 33 | Box::end(); |
|
| 34 | } else { |
|
| 35 | parent::run(); |
|
| 36 | } |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||