From 8d84af67312c3cd4758a41efce6da5a7b78093bd Mon Sep 17 00:00:00 2001 From: sanchezzzhak Date: Tue, 19 Jan 2016 11:31:45 +0300 Subject: [PATCH] rename methods --- GridView.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/GridView.php b/GridView.php index 7ad0c59..1667146 100644 --- a/GridView.php +++ b/GridView.php @@ -24,11 +24,12 @@ class GridView extends \yii\grid\GridView public $paginationPageSize = [20,50,100,300]; - public $menuColumns = true; + public $menuColumns = true; + //public $resizeColumn = true; + public $menuColumnsBtnLabel = 'Show / hide columns'; public $toolbar = [ - //{menu} {pageSize} 'default' => '
{pageSize}
{menu}
@@ -46,7 +47,7 @@ public function init() public function run() { - $this->prepareShowHideColumns(); + $this->prepareVisibilityColumns(); echo Html::beginTag('div',['class' => 'kak-grid']); parent::run(); echo Html::endTag('div'); @@ -57,7 +58,7 @@ public function renderActions() return ''; } - public function renderPaginationPageSize() + public function renderPageSize() { if (!$this->paginationPageSize || !count($this->paginationPageSize)) { return ''; @@ -81,7 +82,7 @@ public function renderSection($name) case '{toolbar}': return $this->renderToolbar(); case '{pageSize}': - return $this->renderPaginationPageSize(); + return $this->renderPageSize(); case '{actions}': return $this->renderActions(); } @@ -138,7 +139,7 @@ public function renderTableRow($model, $key, $index) - protected function prepareShowHideColumns() + protected function prepareVisibilityColumns() { $key = 'kak-grid_'.$this->id; if(count($this->columns) > 0 && $this->menuColumns && isset($_COOKIE[$key])){ @@ -259,9 +260,9 @@ public function renderFilters() $cells[] = $column->renderFilterCell(); } return Html::tag('tr', implode('', $cells), $this->filterRowOptions); - } else { - return ''; } + + return ''; }