Welcome Guest, Not a member yet? Register   Sign In
Basic controller method not working!!?
#1

[eluser]behnampmdg3[/eluser]
Hi;

localhost/secure/results/ shows a list of products:
Code:
class Results extends CI_Controller {

public function index($record_starts=0)
  {
   $data = array('title'=>'Mysql Php MVC, the right way', 'header'=>'Search for a product');
   $this->load->model('model_products');
   $data['results'] = $this->model_products->results_products($this->session->userdata('search_data'), $record_starts);
   $this->load->view('results',$data);
   $this->output->enable_profiler(TRUE);
  }

}

Why do I get 404 from localhost/secure/results/12502Thanks
#2

[eluser]TheFuzzy0ne[/eluser]
CodeIgniter is looking for a method named "12502".

You'll need do one of the following:
a) Call your URL like this: localhost/secure/results/index/12502
b) Set up a [url="http://ellislab.com/codeigniter/user-guide/general/routing.html"]route[/url]
c) Use [url="http://ellislab.com/codeigniter/user-guide/general/controllers.html#remapping"]_remap()[/url] and reroute the call (probably overkill).




Theme © iAndrew 2016 - Forum software by © MyBB