php - URL issue with route setting -


$route['allgrant'] = "grant/allgrant"; 

the above working fine url: http://localhost/grant/allgrant

but getting error url http://localhost/grant/allgrant/6

my route setting below:

$route['allgrant/(:num)'] = "grant/allgrant/$1"; 

my controller code:

public function allgrant() {     $this->load->library('pagination');     $config = array();     $config["base_url"] = base_url('allgrant');     $config['total_rows'] =   $this->db->count_all("grant_data");     $config['per_page'] = 3;     $config["uri_segment"] = 2;     $this->pagination->initialize($config);     $page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;     $data["allgrant"] = $this->grant_model->allgrant($config["per_page"], $page);         $data["links"] = $this->pagination->create_links();     $data['maincontent'] = 'viewgrant';     $this->load->view('include/template',$data); } 

when load grant page show me first 3 result when click on pagination give error page not found

try 1 add route in file

$route['grant/allgrant/(:num)'] = "grant/allgrant/$1"; 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -