Session, some fixes in PagerView and ErrorView #16

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@126 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
pzinovkin
2010-03-14 16:12:52 +00:00
parent d0630c4240
commit c9b35cf6f0
5 changed files with 213 additions and 33 deletions

View File

@ -26,8 +26,12 @@ class PagerAction extends Action
protected function execute()
{
$page = (int) Env::Get('p');
$this->last_page = ceil($this->count/$this->limit);
$this->last_page = ceil($this->count / $this->limit);
if (Env::Get('p') == 'last') {
$page = $this->last_page;
} else {
$page = (int) Env::Get('p');
}
$this->page = ($page <= $this->last_page && $page > 0) ? $page : 1;
$this->offset = $this->limit * ($this->page - 1);
}