-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGridView.php
43 lines (37 loc) · 864 Bytes
/
GridView.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
<?php
namespace mmonem\yii2gridview2;
/**
*
*/
class GridView extends \yii\grid\GridView
{
/**
* @var bool
*/
public $editColumns = [];
public $createUrl;
/**
* Runs the widget.
*/
public function run()
{
$this->layout = str_replace('{items}', '{localForm}{items}', $this->layout);
parent::run();
}
public function renderSection($name)
{
switch ($name) {
case '{localForm}':
return $this->renderLocalForm();
default:
return parent::renderSection($name);
}
}
public function renderLocalForm() {
return $this->render('local-form', [
'dataProvider' => $this->dataProvider,
'editColumns' => $this->editColumns,
'createUrl' => $this->createUrl,
]);
}
}