Welcome Guest, Not a member yet? Register   Sign In
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



Theme © iAndrew 2016 - Forum software by © MyBB