01-08-2010, 06:21 AM
[eluser]Jmz[/eluser]
I've been reading up on CI and I think I have the basics, but there's one thing I can't work out about the link structure.
Say I'm making a blog where a user has an admin panel and an add page option. My class for the admin panel would look like:
If I go to mysite.com/admin it does whatever is in the Index function. If I go to mysite.com/admin/add_page it does whatever is in the Add_page function. Makes sense.
What if I want to change the link to mysite.com/admin/pages/add_page so that it's more organised? Can I do this?
I've been reading up on CI and I think I have the basics, but there's one thing I can't work out about the link structure.
Say I'm making a blog where a user has an admin panel and an add page option. My class for the admin panel would look like:
Code:
Class Admin extends Controller{
function Admin(){
parent::Controller();
}
function Index(){
//Do something
}
function Add_page(){
//Do something
}
}
If I go to mysite.com/admin it does whatever is in the Index function. If I go to mysite.com/admin/add_page it does whatever is in the Add_page function. Makes sense.
What if I want to change the link to mysite.com/admin/pages/add_page so that it's more organised? Can I do this?