Welcome Guest, Not a member yet? Register   Sign In
URI segment in index function?
#3

[eluser]TheFuzzy0ne[/eluser]
...Or you can call your URL like this:

http://domain.com/index.php/category/index/2 (Yuck)

I would suggest that you create another method, perhaps show_category or something like that, and use the index method to alias it. Basically, it will only alias it when there are no arguments, but from then on, the user will be using show_category.

Code:
function index()
{
    // This is the first page the user sees (it's called without any arguments)
    $this->show_category();
}

function show_category($id=FALSE)
{
    // All of your logic goes in here
}


Messages In This Thread
URI segment in index function? - by El Forum - 03-12-2009, 05:45 AM
URI segment in index function? - by El Forum - 03-12-2009, 06:06 AM
URI segment in index function? - by El Forum - 03-12-2009, 06:59 AM
URI segment in index function? - by El Forum - 03-12-2009, 07:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB