Welcome Guest, Not a member yet? Register   Sign In
substituting post id for parameter id
#1

[eluser]msteudel[/eluser]
So I have a typical url parameter

/group/update/9

Controller: Group
Method: Update
id: 9


my update method expects the id as the first paramater

function update( $id ) {
// code
}

I was wondering if there were any built in functionality to support posting the id to:

/group/update

And still have CI pass in the id as the first paramater, sorta like using $_REQUEST instead of explicitly using for $_GET.

Thanks, Mark
#2

[eluser]danmontgomery[/eluser]
You could do that using remap, something like:

Code:
function _remap($method)
{
    $this->$method($this->input->post('id'));
}

http://ellislab.com/codeigniter/user-gui...#remapping
#3

[eluser]msteudel[/eluser]
Cool thanks!




Theme © iAndrew 2016 - Forum software by © MyBB