Browse Source

Updated Paginator to fit better with bootstrap 2.1

The Paginator Renders a list of links compatible with bootstrap 2.1 standards ... so the irritating bug that used to be there on active and disabled pages is gone
kapil verma 12 years ago
parent
commit
f97fb3a457
1 changed files with 4 additions and 4 deletions
  1. 4 4
      laravel/paginator.php

+ 4 - 4
laravel/paginator.php

@@ -183,7 +183,7 @@ class Paginator {
 			$links = $this->slider($adjacent);
 		}
 
-		$content = $this->previous().' '.$links.' '.$this->next();
+		$content = '<ul>' . $this->previous() . $links . $this->next() . '</ul>';
 
 		return '<div class="pagination">'.$content.'</div>';
 	}
@@ -300,7 +300,7 @@ class Paginator {
 		// the "first" element should be a span instead of a link.
 		if ($disabled($this->page, $this->last))
 		{
-			return HTML::span($text, array('class' => "{$class} disabled"));
+			return '<li'.HTML::attributes(array('class'=>"{$class} disabled")).'><a href="#">'.$text.'</a>';
 		}
 		else
 		{
@@ -349,7 +349,7 @@ class Paginator {
 		{
 			if ($this->page == $page)
 			{
-				$pages[] = HTML::span($page, array('class' => 'current'));
+				$pages[] = '<li class="active"><a href="#">'.$page.'</a></li>';
 			}
 			else
 			{
@@ -372,7 +372,7 @@ class Paginator {
 	{
 		$query = '?page='.$page.$this->appendage($this->appends);
 
-		return HTML::link(URI::current().$query, $text, compact('class'), Request::secure());
+		return '<li'.HTML::attributes(compact($class)).'>'. HTML::link(URI::current().$query, $text, [], Request::secure()).'</li>';
 	}
 
 	/**