help with routes |
in routes.php i have:
PHP Code: $route['admin/orders'] = 'admin_orders/index'; in admin_orders.php i have: PHP Code: public function delete(){ and in the view: Code: <a href="'.site_url("admin").'/orders/delete/3'.'" class="btn btn-info">Delete</a> and when i press the Delete the app reload the page, and if i try without the /(:any) the function loads, how i can load the function with a parameter?
I think you should move the 2nd route to last.
PHP Code: $route['admin/orders'] = 'admin_orders/index';
You should also move the first line to be the last.
Website: http://avenir.ro
(07-21-2015, 04:34 PM)GoncaloF Wrote: in routes.php i have: Why don't you do it like this: Code: $route['admin/orders/delete/(:any)'] = 'admin_orders/delete/$1'; For your delete method: PHP Code: public function delete($id){ And in your view: PHP Code: <a href="'. site_url('admin/orders/delete/') . $id . '" class="btn btn-info">Delete</a>
Romanian CodeIgniter Team :: Translations :: Comunity :: Developers
http://www.codeigniter.com.ro |
Welcome Guest, Not a member yet? Register Sign In |