Welcome Guest, Not a member yet? Register   Sign In
Calling multiple Views...
#2

[eluser]pilotLight_Tre[/eluser]
You are looking for the Layout Library: http://codeigniter.com/wiki/layout_library/

It does exactly what you are looking to do. Instead of a separate header and footer view file, you will only need one main view file to display both the header and footer.

This is how you would use it:

Code:
class Demo extends Controller
{
function __construct()
{
parent::Controller();

$this->load->library('library');

$this->layout->setLayout('location/of/main_layout');
}

function index()
{
$templatedata['title'] = 'Hello world';

$this->layout->view('location/of/main_view', $template_data);
}

}


Messages In This Thread
Calling multiple Views... - by El Forum - 02-23-2009, 02:45 PM
Calling multiple Views... - by El Forum - 02-23-2009, 04:14 PM
Calling multiple Views... - by El Forum - 02-23-2009, 06:18 PM
Calling multiple Views... - by El Forum - 02-23-2009, 07:45 PM
Calling multiple Views... - by El Forum - 02-23-2009, 07:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB