routes.php
$route['order/thank_you/(:num)'] = 'thanks/thank_you/$1';
The left hand side is the URL accessed by the users. And the right hand side is where your request going to.
For example, the request example.com/order/thank_you/344
is going to the function thank_you()
of the Controller thanks
.
$1
is the argument. If have more than one, just /$1/$2/
.
The Controller
public function friends_profile ($id = NULL) {
echo "This is the ID I want to thank to " .$id;
}
The function arguments can be passed directly by the route. $id
is the argument passed by the URI.
By the way, check out the Codeigniter URI Routing Guide to get more information.