Hey there.. noob here.
I am trying to build a 3 level deep url loading a view at each stage.
My controllor for a user dashboard: dash.php
function index() {
$data = array(
'morecontent' => '',
);
$content = $this->load->view('dash/index',$data,true);
$this->wrapOutput($content,"Dashboard","dash");
}
This gives me http://somesite.com/dash
So there is sub section of the dashboard called the account settings
function settings() {
$data = array(
'morecontent' => $this->load->view('dash/settings',array(),true),
);
$content = $this->load->view('dash/index',$data,true);
$this->wrapOutput($content,"Dashboard > Settings","dash");
}
So above I am loading the settings view into the dash view… and it gives me http://somesite.com/dash/settings
So I want to now load a payment view into settings.. and have the final url be http://somesite.com/dash/settings/payment
My instinct is to create a function called payment() inside of the settings() function.. sort of like nesting folders in a file strcture… but that is not how CI works.
I need to have 3 or 4 subpages inside of settings, that is inside of dash… How best to accomplish this?
Sorry if it does not make sense.. I am thinking like a file system.. if I want to group pages into categories I just nest the file structure… how does one nest functions in a controllor to created nested url’s?
It is important for us to use this 3 level structure as /dash will have many 2nd level pages which in turn have more 3rd level pages. like /dash/profile/bio and /dash/profile/privacy etc.
