• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Practical Examples Using URI Segments For URL's

#2
[eluser]techgnome[/eluser]
OK... so let's say I have a news controller... and I want to view a specific article...

So I create a news controller, with an article method, that takes one parameter.
Code:
class News extends Controller {
.
.
.
    function article ($articleID)
    {    
        $queryData = $this->gnome_news->get_article($articleID);
        $data['articleCount'] = count($queryData);
        $data['articles'] = $queryData;
        $this->load->view('news/news_article', $data);
    }

...

Now my urls look like {base url}/news/article/123

Does that help?

-tg


Messages In This Thread
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 12:02 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 04:11 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 04:23 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 07:20 PM
Practical Examples Using URI Segments For URL's - by El Forum - 10-26-2010, 07:30 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.