Skip to content

Commit

Permalink
Merge pull request #123 from petrtr/patch-1
Browse files Browse the repository at this point in the history
Update Datatables.php
  • Loading branch information
Kamil Tunkiewicz committed Jul 25, 2014
2 parents 593f1a2 + 0f7c12c commit 485c1e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Bllim/Datatables/Datatables.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public function __construct() {
// version < 1.10

$this->input['draw'] = Input::get('sEcho','');
$this->input['start'] = Input::get('iDisplayStart','');
$this->input['length'] = Input::get('iDisplayLength','');
$this->input['start'] = Input::get('iDisplayStart');
$this->input['length'] = Input::get('iDisplayLength');
$this->input['search'] = array(
'value' => Input::get('sSearch',''),
'regex' => Input::get('bRegex',''),
Expand Down Expand Up @@ -432,7 +432,7 @@ protected function include_in_array($item,$array)
*/
protected function paging()
{
if(!is_null($this->input['start']) && $this->input['start'] != -1)
if(!is_null($this->input['start']) && !is_null($this->input['length']))
{
$this->query->skip($this->input['start'])->take((int)$this->input['length']>0?$this->input['length']:10);
}
Expand Down

0 comments on commit 485c1e0

Please sign in to comment.