[eluser]Unknown[/eluser]
I am new to CI,
This is my code
Code:
<?php
class Home extends Controller {
/**
*
* Enter description here ...
*/
function __construct() {
parent::Controller();
}
/**
*
* Enter description here ...
*/
function index() {
$data = "";
$data['view_pagetitlebar'] = "Welcome | Muhammad Ahmed";
$data['view_metadata'] = "metadata";
$data['view_stylesheet'] = "css style sheet";
$data['view_navlinks'] = "nav links";
$data['view_pagetitle'] = "asd";
$data['view_contents_left'] = "Left side content";
$data['view_footer'] = "Footer";
$data['view_contents_right'] = "This is the home page";
$this->load->view('view_main', $data);
}
/**
*
* Enter description here ...
*/
function about() {
$data = "";
$data['view_pagetitlebar'] = "Welcome | Muhammad Ahmed";
$data['view_metadata'] = "metadata";
$data['view_stylesheet'] = "css style sheet";
$data['view_navlinks'] = "nav links";
$data['view_pagetitle'] = "asd";
$data['view_contents_left'] = "Left side content";
$data['view_footer'] = "Footer";
$data['view_contents_right'] = "This is the about page";
$this->load->view('view_main', $data);
}
}
we can see each time maximum data remains the same, only 'view_contents_right' is different in each function.
If i made a new function or any new controller i need to paste all the data again with update 'view_contents_right' data...
Can we controller this redundant data..
Any link, or any thing that can help me...
Thanks,
Muhammad Ahmed