URI Segment problem |
[eluser]sohei[/eluser]
Hi everybody, I simply want to get an id by the url. Here's my function in my controller called "stock": Code: function delete_single_item($iditem) { And when I go here: http://localhost/mywebsite/stock/delete_single_item/167 I get this error: Quote:"Missing argument 1 for Stock::delete_single_item()" Can anyone tell me why ? It looks so simple and it doesn't work...
[eluser]LuckyFella73[/eluser]
Are you using URI Routing? Usually it should work like you tried to (reading the user guide). I use to get the uri parameters using the URI function Code: $this->uri->segment(n) Code: function delete_single_item() { Should work ..
[eluser]sohei[/eluser]
[quote author="LuckyFella73" date="1292804697"]Are you using URI Routing? Usually it should work like you tried to (reading the user guide). I use to get the uri parameters using the URI function Code: $this->uri->segment(n) Code: function delete_single_item() { Should work ..[/quote] Nope, the only routing rules I have is the default Code: $route['default_controller'] = "home"; And when I try this with http://localhost/mywebsite/stock/delete_single_item/168: Code: function delete_single_item() { It return nothing.. I really don't see what's wrong EDIT: Could it come from my URL Rewriting? (used to remove index.php)
[eluser]sohei[/eluser]
It's okay, I don't know why but I had autoload the uri: Code: $autoload['libraries'] = array('database','uri'); Now I have remove it and it works. Thank you anyway LuckyFella.
[eluser]LuckyFella73[/eluser]
I found it strange too that it didn't work from the beginning.. It still strange because according to the user guide the uri class is loaded by default... |
Welcome Guest, Not a member yet? Register Sign In |