Commit dfb3d35f authored by Taylor Otwell's avatar Taylor Otwell

add ability to specify the language on the paginator.

parent 16a21422
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment