[eluser]nirbhab[/eluser]
STEP1:
load the MODEL in constructor of your Controller so that it is available every where.
STEP2:
load view in any method.
STEP3:
load model in loaded view.
Step4:
you can let model perform any work for you
a. load multiple view
b. db manipulations etc.
c. anything you want to.
SAMPLE:
Controller:[blog.php]
Code:
class Blog extends Controller {
function Blog()
{
parent::Controller();
$this->load->model('fubarModel', 'fubar');
}
function index()
{
$this->load->view('name');
}
}
VIEW:[name.php]
Code:
<b>Name View!
$this->fubar->fubarFunction();
</b>
MODEL:[fubarModel.php]
Code:
class fubarModel extends Model {
function fubarModel()
{
parent::Model();
}
function fubarFunction()
{
$this->load->view('secondname');
}
}
VIEW2['secondname.php']
Code:
<i>Second name view</i>