I am new to codeigniter so please excuse my stupidity.
I am building a client portal and I have my admin / client login setup I am currently working on the admin area first so I have my controller for admin setup and it loads a view stored;
views (folder) -> admin (folder) -> admin-view.php
I wanted to keep all my admin panel views in the folder admin within the views folder.
Anyway so I have setup my links to pages in the admin panel like;
<a href="./admin/company">Client Companies</a><br/>
<a href="./admin/client_view">Client List</a><br/>
<a href="./admin/rig_list">Rigs / Platforms</a><br/>
Now I understand that when you call a url like I have /admin/ is the controller and /company/ is the function which is called.
Now I would like to call a controller for company for this page because I have a lot of code in the company controller which defines what views and what data to pull for the company page of the admin panel.
Right now my function in admin for company looks like;
function company(){
log_message('debug', 'company_view Function Ran');
$data['page_title'] = 'Bomar Client Portal - Admin Area';
$this->load->view('admin/header', $data);
$this->load->view('admin/admin_navigation');
$this->load->view('admin/company_view', $data);
$this->load->view('admin/footer');
}
which I would like to replace just to call the company controller, I have looked into similar questions for calling controllers from controllers and everyone recommends against it.
So if I shouldn't call the controller for company from the admin controller how would I keep the url to point to /admin/company/
I know I could easily point to /company/ and it would render the page using the controller for company but I would like to keep the admin bit in the url if you understand where im coming from? is this a case of "you can't do it stop being so picky!"?