[eluser]jrtashjian[/eluser]
Well, to keep it simple you'd need to create a controller with the 3 pages. Your controller could be called 'Pages' and you would have methods for each page (home, products, about). You would process everything for each page in the specified controller method and load the views at the end, while passing the data needed for each view. Quick example:
/application/controllers/pages.php
Code:
class Pages extends Controller
{
function Pages()
{
parent::Controller();
}
function home()
{
// process everything for page 'home' here
// store vars in array for passing to views
$vars = array();
$vars['title'] = "Page Title";
// pass variables to view
$this->load->vars($vars);
// load views
$this->load->view('header');
$this->load->view('home');
$this->load->view('footer');
}
function products()
{
// process everything for page 'product' here
// store vars in array for passing to views
$vars = array();
$vars['title'] = "Page Title";
// pass variables to view
$this->load->vars($vars);
// load views
$this->load->view('header');
$this->load->view('products');
$this->load->view('footer');
}
function about()
{
// process everything for page 'about' here
// store vars in array for passing to views
$vars = array();
$vars['title'] = "Page Title";
// pass variables to view
$this->load->vars($vars);
// load views
$this->load->view('header');
$this->load->view('about');
$this->load->view('footer');
}
}
Hope this helps! Remember, there is no right or wrong way to do something. Do what works for you.