[eluser]PhilTem[/eluser]
Okay, some really quick and dirty code for the lazy:
With Routing:
Code:
$route['event/(:any)/registration'] = 'event/registration/$1';
$route['event/(:any)/join'] = 'event/join/$1';
in the controller
Code:
class Event extends CI_Controller {
function registration($event_id)
{
// do registration stuff here
}
function join($event_id)
{
// do join stuff here
}
}
Or, with _remap, there's no need for routing!
Code:
class Event extends CI_Controller {
function _remap()
{
$event_id = $this->uri->segment(2);
if ( $method = $this->uri->segment(3) )
{
return call_user_func_array(array(&$this, $method), $event_id);
}
else
{
// Do whatever you want to do when the URI is just like
// www.example.com/event/EVENT_ID
}
}
function registration($event_id)
{
// do registration stuff here
}
function join($event_id)
{
// do join stuff here
}
}