[eluser]liri[/eluser]
Hey,
I decided to use CI for a new application I'm working on and I will welcome any pointers in guiding me towards the best approach, as I have some dilemmas regarding a couple of things.
First problem I'm facing is this - the app's navigation is 2 degrees, so I have categories and sub categories such as:
* Application
* Reports
* Management
* Configuration
* DB
* Language
I decided to start first with the Configuration part which doesn't encompass a whole lot of stuff and created a controller directory for it. For views - I wanted it to be really modular so I've broke it down into header.php, footer.php, etc... and put it in views/template/header.php etc...
Now, for the "index" page of the Configuration page I'm doing something like:
Code:
...
private $__menuCategory = "Configuration";
...
function index()
{
$menu['menuCategory'] = $this->_getMenuCategory();
$this->load->helper('url');
$this->load->view('template/header.php');
$this->load->view('template/menu.php', $menu);
$this->load->view('template/main.php');
$this->load->view('template/footer.php');
}
And in the menu.php view I'm checking which page is it to draw the specific category link in bold for example.
Question is - now to proceed with the view for the subcategory "DB" should I have another funtion db() for it and perform the same load->view() methods?
I'm not sure this is the proper way to do things, with procedural code these things are obviously alot simpler and I'd appreciate some feedback on how to continue.
Thanks.