[eluser]huzzi[/eluser]
This is how I do it.
Extend the default controller as shown, this file goes inside the libraries folder.
MY_Controller.php
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class MY_Controller extends Controller {
protected $data = array();
protected function __construct() {
parent::__construct();
$this->load_defaults();
}
protected function load_defaults() {
$this->data['pageTitle'] = 'Page Title';
}
}
?>
Now in the controller set the page title.
Code:
<?php
class Form extends MY_Controller {
function __construct() {
parent::__construct();
}
function index()
{
$this->data['pageTitle'] = 'Your page title';
$this->load->view('homepage');
}
}
?>
View
Code:
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo $pageTitle; ?></title>
</head>
<body>
<?php echo $content; ?>
</body>
</html>
Hope this helps.