|
@ -11,22 +11,22 @@ |
|
|
|
|
|
|
|
|
class PagerAction extends Action |
|
|
class PagerAction extends Action |
|
|
{ |
|
|
{ |
|
|
public $page; |
|
|
|
|
|
public $last_page; |
|
|
|
|
|
|
|
|
public $page = 1; |
|
|
|
|
|
public $last_page = 1; |
|
|
protected $offset = 0; |
|
|
protected $offset = 0; |
|
|
protected $count = 0; |
|
|
|
|
|
protected $limit; |
|
|
protected $limit; |
|
|
|
|
|
|
|
|
public function __construct($count, $limit = 20) |
|
|
|
|
|
|
|
|
public function __construct($limit = 20) |
|
|
{ |
|
|
{ |
|
|
$this->count = $count; |
|
|
|
|
|
$this->limit = $limit; |
|
|
$this->limit = $limit; |
|
|
parent::__construct(); |
|
|
parent::__construct(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected function execute() |
|
|
|
|
|
|
|
|
protected function execute() {} |
|
|
|
|
|
|
|
|
|
|
|
public function setCount($count) |
|
|
{ |
|
|
{ |
|
|
$this->last_page = ceil($this->count / $this->limit); |
|
|
|
|
|
|
|
|
$this->last_page = ceil($count / $this->limit); |
|
|
if (Env::Get('p') == 'last') { |
|
|
if (Env::Get('p') == 'last') { |
|
|
$page = $this->last_page; |
|
|
$page = $this->last_page; |
|
|
} else { |
|
|
} else { |
|
@ -38,12 +38,12 @@ class PagerAction extends Action |
|
|
|
|
|
|
|
|
public function getOffset() |
|
|
public function getOffset() |
|
|
{ |
|
|
{ |
|
|
return $this->offset; |
|
|
|
|
|
|
|
|
return (int) $this->offset; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getLimit() |
|
|
public function getLimit() |
|
|
{ |
|
|
{ |
|
|
return $this->limit; |
|
|
|
|
|
|
|
|
return (int) $this->limit; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected function getTemplate() |
|
|
protected function getTemplate() |
|
|