Skip to content

Commit 76576d9

Browse files
committed
add sort by key
1 parent 1b85cb6 commit 76576d9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/PhpTableGenerator/HeadCell.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class HeadCell extends Cell
5656
/**
5757
* @var
5858
*/
59-
private $sortBy;
59+
private $sortByKey;
6060

6161
/**
6262
* @var
@@ -188,17 +188,17 @@ public function setSelectable($selectable, $selectAllSelector = '')
188188
/**
189189
* @return string
190190
*/
191-
public function getSortBy()
191+
public function getSortByKey()
192192
{
193-
return $this->sortBy;
193+
return $this->sortByKey;
194194
}
195195

196196
/**
197-
* @param string $sortBy
197+
* @param string $sortByKey
198198
*/
199-
public function setSortBy($sortBy)
199+
public function setSortByKy($sortByKey)
200200
{
201-
$this->sortBy = $sortBy;
201+
$this->sortByKey = $sortByKey;
202202
}
203203

204204
/**
@@ -273,13 +273,13 @@ public function getContent()
273273
}
274274

275275
$alias = $this->getAlias();
276-
$sortBy = $this->getSortBy();
276+
$sortByKey = $this->getSortByKey();
277277

278278
$newSortDir = $this->getNewSortDir();
279279

280280
$sortFunction = $config->getConfig('sorterJSFunction');
281281
$sortDirKey = $this->getSortDirKey();
282282

283-
return "{$checkboxHtml} <a style='cursor: pointer;' onclick='{$sortFunction}(\"{$sortBy}\", \"{$alias}\", \"{$sortDirKey}\", \"{$newSortDir}\");'>{$title}</a>";
283+
return "{$checkboxHtml} <a style='cursor: pointer;' onclick='{$sortFunction}(\"{$sortByKey}\", \"{$alias}\", \"{$sortDirKey}\", \"{$newSortDir}\");'>{$title}</a>";
284284
}
285285
}

0 commit comments

Comments
 (0)