[eluser]hailwood[/eluser]
I am wondering if it is possible in code igniter to have sub controllers?
By this I mean.
I have my message controller.
inside the controller I have "pages(functions)" called sent/settings/view/ ect
so
Quote:example.com/messages/sent
example.com/messages/settings
example.com/messages/view
this works fine.
But now I want to add one called lists,
This is ok except.
The lists one needs to have its own methods. such as create/edit/view
So the url would be
Quote:example.com/messages/list/create
example.com/messages/list/edit
example.com/messages/list/view
What is the best way to handle this situation?
I have a lists model so I could have
Code:
class Messages extends Controller {
...
function list($func){
$this->load->model('lists');
$this->lists->$func();
...
}
...
}
But I really dont want to do it that way. as it makes it difficult for handling params and doing other actions.
I could do
Code:
class Messages extends Controller {
...
function list($func){
$this->load->model('lists');
switch($func):
...
endswitch;
...
}
...
}
But I dont want to do that either as the function could get quite large.