config/routes.php:
$route['registrars'] = 'registrars'; $route['registrars/:num'] = 'registrars';
controllers/registrars.php:
public function index($id=0) { $this->load->model('registrars_model'); $this->load->model('domains_model'); $data['title'] = 'Registrars'; $data['description'] = 'Browse and update your registrars, see the number of domains you have with each of them.'; if ($id==0) { $this->load->view('registrars_view', $data); } else { $data['id'] = $id; $this->load->view('single_reg_view', $data); } }
działa bez podania id, czyli http://example.com/registrars
ale - co dziwne - działa gdy zdubluję i podam tak: http://dev/ci/index.php/registrars/registrars/1
podejrzewam, że route jest źle skonfigurowane, poratuje ktoś pomocną CI-dłonią?