[eluser]Derdiusz[/eluser]
You can also add an array variable to your controller:
Code:
class Home extends Controller {
var $data = array();
and in your constructor put your static data:
Code:
function __construct() {
parent::Controller();
$this->data['view_pagetitlebar'] = "Welcome | Muhammad Ahmed";
$this->data['view_metadata'] = "metadata";
$this->data['view_stylesheet'] = "css style sheet";
$this->data['view_navlinks'] = "nav links";
$this->data['view_pagetitle'] = "asd";
$this->data['view_contents_left'] = "Left side content";
$this->data['view_footer'] = "Footer";
}
From now load view with:
Code:
$this->load->view('view_main', $this->data);
You able to add (or replace) any data to your $this->data in other methods, like:
Code:
function about() {
$this->data['view_contents_right'] = "This is the about page";
$this->load->view('view_main', $this->data);
}
function home() {
$this->data['view_contents_right'] = "This is the HOME page";
$this->load->view('view_main', $this->data);
}
Greetings
D.