Membuat pagination di Codeigniter

/*start pagination*/
		$this->load->library('pagination');
		$config['base_url'] = base_url().'ga/perhitunganMasuk/daftarHistory/'.$menu.'/';	
		$config['display_pages']=TRUE;
		$config['per_page'] = 1; 
		$config['cur_page'] = $this->uri->segment(5);
		$temp = $this->uri->segment(5);
		if($temp== null || $temp=''){
			$start=0;
		}
		else{
			$start=$this->uri->segment(5);
		}
		$this->pagination->initialize($config);
		$data['pagination'] = $this->pagination->create_links();		
		$data['index'] = $this->uri->segment(5)+1;
		/*end pagination*/

selanjutnya tambahakan

 echo "<br/><br/><span class='pagination'>".$pagination."</span><br><br>";

pada view nya !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: