Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
dfb3d35f
Commit
dfb3d35f
authored
Nov 23, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ability to specify the language on the paginator.
parent
16a21422
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
paginator.php
laravel/paginator.php
+22
-3
No files found.
laravel/paginator.php
View file @
dfb3d35f
...
...
@@ -53,6 +53,13 @@ class Paginator {
*/
protected
$appendage
;
/**
* The language that should be used when creating the pagination links.
*
* @var string
*/
protected
$language
;
/**
* The "dots" element used in the pagination slider.
*
...
...
@@ -274,7 +281,7 @@ class Paginator {
{
$class
=
"
{
$element
}
_page"
;
if
(
is_null
(
$text
))
$text
=
Lang
::
line
(
"pagination.
{
$element
}
"
)
->
get
();
if
(
is_null
(
$text
))
$text
=
Lang
::
line
(
"pagination.
{
$element
}
"
)
->
get
(
$this
->
language
);
// Each consumer of this method provides a "disabled" Closure which can
// be used to determine if the element should be a span element or an
...
...
@@ -348,9 +355,9 @@ class Paginator {
*/
protected
function
link
(
$page
,
$text
,
$class
)
{
$
url
=
URI
::
current
()
.
'?page='
.
$page
.
$this
->
appendage
(
$this
->
appends
);
$
query
=
'?page='
.
$page
.
$this
->
appendage
(
$this
->
appends
);
return
HTML
::
link
(
$url
,
$text
,
compact
(
'class'
),
Request
::
secure
());
return
HTML
::
link
(
URI
::
current
()
.
$query
,
$text
,
compact
(
'class'
),
Request
::
secure
());
}
/**
...
...
@@ -385,4 +392,16 @@ class Paginator {
return
$this
;
}
/**
* Set the language that should be used when creating the pagination links.
*
* @param string $language
* @return Paginator
*/
public
function
speaks
(
$language
)
{
$this
->
language
=
$language
;
return
$this
;
}
}
\ No newline at end of file
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