Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIPagerView.php
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public function setURI(PhutilURI $uri, $paging_parameter) { | ||||
$this->uri = $uri; | $this->uri = $uri; | ||||
$this->pagingParameter = $paging_parameter; | $this->pagingParameter = $paging_parameter; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function readFromRequest(AphrontRequest $request) { | public function readFromRequest(AphrontRequest $request) { | ||||
$this->uri = $request->getRequestURI(); | $this->uri = $request->getRequestURI(); | ||||
$this->pagingParameter = 'offset'; | $this->pagingParameter = 'offset'; | ||||
$this->offset = $request->getInt($this->pagingParameter); | |||||
$offset = $request->getInt($this->pagingParameter); | |||||
if ($offset === null) { | |||||
$offset = 0; | |||||
} | |||||
$this->offset = $offset; | |||||
return $this; | return $this; | ||||
} | } | ||||
public function willShowPagingControls() { | public function willShowPagingControls() { | ||||
return $this->hasMorePages || $this->getOffset(); | return $this->hasMorePages || $this->getOffset(); | ||||
} | } | ||||
public function getHasMorePages() { | public function getHasMorePages() { | ||||
▲ Show 20 Lines • Show All 186 Lines • Show Last 20 Lines |