Hello im working with code igniter and I try to send parameters from url into view to controller
My Controller
public function mainView($num=null) {
$this->load->view('header');
// $data = array('foo[' => 'Hello', 'bar' => 'world');
if (!isset($_SESSION[$this::jsondevices])) {
var_dump("Descargo");
$_SESSION[$this::jsondevices] = $this->restlib->consumirDominiosDeMoca($this->restmodel->modelUserDevices());
$_SESSION[$this::jsontags] = $this->restlib->consumirDominiosDeMoca($this->restmodel->modelTagsMoca());
}
var_dump("No descargo");
$data = $this->piemodel->mainValues($this, $_SESSION[$this::jsondevices], $_SESSION[$this::jsontags]);
$this->load->view('user/login/vistachart', $data);
$this->load->view('footer');
}
My js
window.location.href = "<?= base_url('home2/$1')?>";
And my route
$route['home2/(:num)'] = 'user/mainView/$1';
And the result
404 Page Not Found
But I try with $route['home'] = 'user/mainView';
Work's
What Im doing wrong?