[eluser]Trankh1[/eluser]
Hi,
I want to make my CodeIgniter application modular and for that, my views are organized with "micro-views" .
For example:
For the homePage view,
Code:
<?php
$this->load->view('includes/view1');
$this->load->view('includes/view2');
$this->load->view('includes/view3'); ?>
Each micro-view can be called into multiple views.
It means that, for the user view,
The view can be organized as :
Code:
<?php
$this->load->view('includes/view2'); // the same micro view as homepage
?>
For modularity reason (data loading and display), I want to attach a controller for each micro-view.
Thus, if i want to move, delete or add a micro-view into a view, I just need to modify my micro-view instead of my controller.
It means, that inside my micro-view, I call my attached controller in order to load data.
And if i want to use a micro view into an other view, i don't need to update the controller of the other view. I just need to update the other view file adding this line:
Code:
$this->load->view('includes/view2');
What do you think of that? It can save me a lot of time.