在codeigniter处路由不起作用

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?

Your order of using :any is wrong, as this will likely match before the rest. Even if it's not things should be listed in the more general last just to be safe, because as the router works through the rules it will stop when it says ok that matches, and if it's the more general or generic rules first then it never reaches the specific. Just as a rule of best practice things should be listed the more specific first and more generic last. This is why the else comes after the if and ifelse in standard conditional logic ( which is obvious ) but in cases like this it's easy to overlook simple rules like that..

see also https://ellislab.com/codeigniter/user-guide/general/routing.html

the important bits are

(:num) will match a segment containing only numbers. (:any) will match a segment containing any character.

Note: Routes will run in the order they are defined. Higher routes will always take precedence over lower ones.