The following is a valid REST based URL that can be used to access a resource:
Using codeigniter, how can one access the parameter of 1 that was passed below.
I saw the above in a tutorial and have set up my code. However obviously:
$id = $this->input->get('id');
does not work.
Using $this->input->get('id')
would suggest you are sending ?id=1 to the end of the URL. You can use $this->uri->segment(1)
but that does not allow for paired uri segments.
If you use $this->get('id')
which is a special REST_Controller method then it will pick up either. I did put that in the tutorial you got this image from :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With