I'm staring learning codeigniter (I'm using version 3.0.0), but i have a porblem when I'm trying routing with parameters
In the file routes.php I have:
$route['admin/orders'] = 'admin_orders/index';
$route['admin/orders/(:any)'] = 'admin_orders/index';
$route['admin/orders/getAll'] = 'admin_orders/getAll';
$route['admin/orders/getLast'] = 'admin_orders/getLast';
$route['admin/orders/delete/(:any)'] = 'admin_orders/delete'
;
In admin_orders.php i have:
public function delete(){
$id = $this->uri->segment(4);
echo "ok $id";
}
And in the view:
<a href="'.site_url("admin").'/orders/delete/3'.'" class="btn btn-info">Delete</a>
But when I press the Delete the app reload the page, and if i try without the /(:any) the function loads and show me the message and the other routes are working
Certainly I'mm doing something wrong, how I can load one function with a parameter using codeigniter 3?