Problem using uri->segment - should be easy....[SOLVED] |
[eluser]tinawina[/eluser]
Hi CodeIgniters - This is totally strange. I'm just trying to throw together a simple rating script. People log in and get the opportunity to rate an article. They click on a graphic -- stars representing a rating of 1, 2, 3, 4, or 5. The URL leads to my ratings controller and looks like this: http://mysite.org/ratings/name_of_article/1 (if they chose to give a "1" rating) In my routes.php file I have this setting established: $route['ratings/:any'] = "ratings/index"; I can't seem to get anything out of $this->uri->segment(3) which would be the rating. I can get the article name from $this->uri->segment(2) with no problem. But where segment(3) is concerned I get this error message: Fatal error: Call to a member function segment() on a non-object..... That message refers to the line that tries to assign $this->uri->segment(3) to $this->rating. I'm not sure what's gone wrong -- this always has worked for me just fine before. Any ideas? Thanks for your help! Ratings controller: Code: class Ratings extends Controller |
Messages In This Thread |
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 12:51 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 02:19 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 04:13 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 04:22 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 04:24 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 04:42 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 05:23 PM
|