fuel/fuel/core/classes/pagination.php
public function pages_render()
	{
		// no links if we only have one page
		if ($this->config['total_pages'] == 1)
		{
			return '';
		}

		$html = '';

		// calculate start- and end page numbers
		$start = $this->config['calculated_page'] - floor($this->config['num_links'] * $this->config['link_offset']);
		$end = $this->config['calculated_page'] + floor($this->config['num_links'] * ( 1 - $this->config['link_offset']));

		// adjust for the first few pages
		if ($start < 1)
		{
			$end -= $start - 1;
			$start = 1;
		}

		// make sure we don't overshoot the current page due to rounding issues
		if ($end < $this->config['calculated_page'])
		{
			$start++;
			$end++;
		}

		// make sure we don't overshoot the total
		if ($end > $this->config['total_pages'])
		{
			$start = max(1, $start - $end + $this->config['total_pages']);
			$end = $this->config['total_pages'];
		}

		for($i = intval($start); $i <= intval($end); $i++)
		{
			if ($this->config['calculated_page'] == $i)
			{
				$html .= str_replace(
				    '{link}',
				    str_replace(array('{uri}', '{page}'), array('#', $i), $this->template['active-link']),
				    $this->template['active']
				);
				$this->raw_results[] = array('uri' => '#', 'title' => $i, 'type' => 'active');
			}
			else
			{
				$html .= str_replace(
				    '{link}',
				    str_replace(array('{uri}', '{page}'), array($this->_make_link($i), $i), $this->template['regular-link']),
				    $this->template['regular']
				);
				$this->raw_results[] = array('uri' => $this->_make_link($i), 'title' => $i, 'type' => 'regular');
			}
		}

		return $html;
	}
public function pages_render()
	{
		// no links if we only have one page
		if ($this->config['total_pages'] == 1)
		{
			return '';
		}

		$html = '';

		// calculate start- and end page numbers
		$start = $this->config['calculated_page'] - floor($this->config['num_links'] * $this->config['link_offset']);
		$end = $this->config['calculated_page'] + floor($this->config['num_links'] * ( 1 - $this->config['link_offset']));

		// adjust for the first few pages
		if ($start < 1)
		{
			$end -= $start - 1;
			$start = 1;
		}

		// make sure we don't overshoot the current page due to rounding issues
		if ($end < $this->config['calculated_page'])
		{
			$start++;
			$end++;
		}

		// make sure we don't overshoot the total
		if ($end > $this->config['total_pages'])
		{
			$start = max(1, $start - $end + $this->config['total_pages']);
			$end = $this->config['total_pages'];
		}

		for($i = intval($start); $i <= intval($end); $i++)
		{
			if ($this->config['calculated_page'] == $i)
			{
				$html .= str_replace(
				    '{link}',
				    str_replace(array('{uri}', '{page}'), array('#', $i), $this->template['active-link']),
				    $this->template['active']
				);
				$this->raw_results[] = array('uri' => '#', 'title' => $i, 'type' => 'active');
			}
			else
			{
				$html .= str_replace(
				    '{link}',
				    str_replace(array('{uri}', '{page}'), array($this->_make_link($i), $i), $this->template['regular-link']),
				    $this->template['regular']
				);
				$this->raw_results[] = array('uri' => $this->_make_link($i), 'title' => $i, 'type' => 'regular');
			}
		}

		return $html;
	}
public function pages_render ( ) { // no links if we only have one page if ( $ this -> config [ 'total_pages' ] == 1 ) { return '' ; } $ html = '' ; // calculate start- and end page numbers $ start = $ this -> config [ 'calculated_page' ] - floor ( $ this -> config [ 'num_links' ] * $ this -> config [ 'link_offset' ] ) ; $ end = $ this -> config [ 'calculated_page' ] + floor ( $ this -> config [ 'num_links' ] * ( 1 - $ this -> config [ 'link_offset' ] ) ) ; // adjust for the first few pages if ( $ start < 1 ) { $ end -= $ start - 1 ; $ start = 1 ; } // make sure we don't overshoot the current page due to rounding issues if ( $ end < $ this -> config [ 'calculated_page' ] ) { $ start ++ ; $ end ++ ; } // make sure we don't overshoot the total if ( $ end > $ this -> config [ 'total_pages' ] ) { $ start = max ( 1 , $ start - $ end + $ this -> config [ 'total_pages' ] ) ; $ end = $ this -> config [ 'total_pages' ] ; } for ( $ i = intval ( $ start ) ; $ i <= intval ( $ end ) ; $ i ++ ) { if ( $ this -> config [ 'calculated_page' ] == $ i ) { $ html .= str_replace ( '{link}' , str_replace ( array ( '{uri}' , '{page}' ) , array ( '#' , $ i ) , $ this -> template [ 'active-link' ] ) , $ this -> template [ 'active' ] ) ; $ this -> raw_results [ ] = array ( 'uri' => '#' , 'title' => $ i , 'type' => 'active' ) ; } else { $ html .= str_replace ( '{link}' , str_replace ( array ( '{uri}' , '{page}' ) , array ( $ this -> _make_link ( $ i ) , $ i ) , $ this -> template [ 'regular-link' ] ) , $ this -> template [ 'regular' ] ) ; $ this -> raw_results [ ] = array ( 'uri' => $ this -> _make_link ( $ i ) , 'title' => $ i , 'type' => 'regular' ) ; } } return $ html ; }
generate the HTML for the page links only

@return	string	Markup for the pagination block
generate the HTML for the page links only