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:
@ -29,11 +29,13 @@ class ErrorAction extends Action
|
||||
if ($this->exception instanceof Error404Exception) {
|
||||
$this->template = 404;
|
||||
}
|
||||
$this->logError();
|
||||
$this->sendHTTPCode();
|
||||
}
|
||||
|
||||
protected function getTemplate()
|
||||
{
|
||||
return '/static/' . $this->template;
|
||||
return '/actions/' . $this->template;
|
||||
}
|
||||
|
||||
protected function sendHttpCode()
|
||||
@ -79,11 +81,4 @@ class ErrorAction extends Action
|
||||
error_log($message);
|
||||
}
|
||||
}
|
||||
|
||||
public function fetch()
|
||||
{
|
||||
$this->logError();
|
||||
$this->sendHTTPCode();
|
||||
return $this->view->fetch($this->getTemplate());
|
||||
}
|
||||
}
|
@ -32,6 +32,7 @@ class FrontController
|
||||
private function __construct()
|
||||
{
|
||||
ErrorHandler::init();
|
||||
Session::start();
|
||||
if (DEBUG == true) {
|
||||
Profiler::getInstance()->start();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user