Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
2cdee7af
Commit
2cdee7af
authored
Jul 21, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring pagination class.
parent
218783ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
system/paginator.php
+13
-8
No files found.
system/paginator.php
View file @
2cdee7af
...
...
@@ -50,6 +50,7 @@ class Paginator {
$this
->
per_page
=
$per_page
;
$this
->
results
=
$results
;
$this
->
total
=
$total
;
$this
->
page
=
static
::
page
(
$this
->
last_page
());
}
...
...
@@ -136,33 +137,37 @@ class Paginator {
/**
* Generate the "previous" HTML link.
*
* @param string $
valu
e
* @param string $
languag
e
* @return string
*/
public
function
previous
(
$
value
=
'« Previous'
)
public
function
previous
(
$
language
=
null
)
{
$text
=
Lang
::
line
(
'pagination.previous'
)
->
get
(
$language
);
if
(
$this
->
page
>
1
)
{
return
HTML
::
link
(
Request
::
uri
()
.
'?page='
.
(
$this
->
page
-
1
),
$
value
,
array
(
'class'
=>
'prev_page'
))
.
' '
;
return
HTML
::
link
(
Request
::
uri
()
.
'?page='
.
(
$this
->
page
-
1
),
$
text
,
array
(
'class'
=>
'prev_page'
))
.
' '
;
}
return
HTML
::
span
(
$
value
,
array
(
'class'
=>
'disabled prev_page'
))
.
' '
;
return
HTML
::
span
(
$
text
,
array
(
'class'
=>
'disabled prev_page'
))
.
' '
;
}
/**
* Generate the "next" HTML link.
*
* @param string $
valu
e
* @param string $
languag
e
* @return string
*/
public
function
next
(
$
value
=
'Next »'
)
public
function
next
(
$
language
=
null
)
{
$text
=
Lang
::
line
(
'pagination.next'
)
->
get
(
$language
);
if
(
$this
->
page
<
$this
->
last_page
())
{
return
HTML
::
link
(
Request
::
uri
()
.
'?page='
.
(
$this
->
page
+
1
),
$
value
,
array
(
'class'
=>
'next_page'
));
return
HTML
::
link
(
Request
::
uri
()
.
'?page='
.
(
$this
->
page
+
1
),
$
text
,
array
(
'class'
=>
'next_page'
));
}
return
HTML
::
span
(
$
value
,
array
(
'class'
=>
'disabled next_page'
));
return
HTML
::
span
(
$
text
,
array
(
'class'
=>
'disabled next_page'
));
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment