Added pagination details showing
This commit is contained in:
@@ -231,6 +231,17 @@ class Paginator
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of current page
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function getPage()
|
||||||
|
{
|
||||||
|
return $this->page;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the default column order
|
* Set the default column order
|
||||||
*
|
*
|
||||||
@@ -270,6 +281,16 @@ class Paginator
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the maximum number of items per page.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getMax()
|
||||||
|
{
|
||||||
|
return $this->limit;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the collection is empty
|
* Return true if the collection is empty
|
||||||
*
|
*
|
||||||
@@ -390,6 +411,17 @@ class Paginator
|
|||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the page showing.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function generatPageShowing()
|
||||||
|
{
|
||||||
|
return '<span class="pagination-showing">'.t('Showing %d-%d of %d', (($this->getPage() - 1) * $this->getMax() + 1), min($this->getTotal(), $this->getPage() * $this->getMax()), $this->getTotal()).'</span>';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if there is no pagination to show
|
* Return true if there is no pagination to show
|
||||||
*
|
*
|
||||||
@@ -413,6 +445,7 @@ class Paginator
|
|||||||
|
|
||||||
if (! $this->hasNothingtoShow()) {
|
if (! $this->hasNothingtoShow()) {
|
||||||
$html .= '<div class="pagination">';
|
$html .= '<div class="pagination">';
|
||||||
|
$html .= $this->generatPageShowing();
|
||||||
$html .= $this->generatePreviousLink();
|
$html .= $this->generatePreviousLink();
|
||||||
$html .= $this->generateNextLink();
|
$html .= $this->generateNextLink();
|
||||||
$html .= '</div>';
|
$html .= '</div>';
|
||||||
|
|||||||
@@ -1288,4 +1288,5 @@ return array(
|
|||||||
// 'Your personal API access token is "%s"' => '',
|
// 'Your personal API access token is "%s"' => '',
|
||||||
// 'Remove your token' => '',
|
// 'Remove your token' => '',
|
||||||
// 'Generate a new token' => '',
|
// 'Generate a new token' => '',
|
||||||
|
'Showing %d-%d of %d' => '本页显示 %d-%d 条,共有: %d 条',
|
||||||
);
|
);
|
||||||
|
|||||||
2
assets/css/app.min.css
vendored
2
assets/css/app.min.css
vendored
File diff suppressed because one or more lines are too long
@@ -3,6 +3,11 @@
|
|||||||
.pagination
|
.pagination
|
||||||
text-align: center
|
text-align: center
|
||||||
|
|
||||||
|
.pagination-showing
|
||||||
|
margin-right: 5px
|
||||||
|
padding-right: 5px
|
||||||
|
border-right: 1px solid #999
|
||||||
|
|
||||||
.pagination-next
|
.pagination-next
|
||||||
margin-left: 5px
|
margin-left: 5px
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user