Welcome Guest, Not a member yet? Register   Sign In
Change the main content per controller change
#1

I've been making school projects and I need ideas on how it can be done
I have 2 view files that is always included when making controller methods

I create a function where the main content will load based on the parameter supplied

Here's the code:
Code:
public function nextPage($link){
 $this->load->view('inc/header_sidebar');
 $this->load->view('pages/' . $link);
 $this->load->view('inc/footer_sidebar');
}

Then using the method like this:
Code:
public function user_index(){

$this->nextPage('user_view');
}

public function patient_index(){
$this->nextPage('patient_index');
}

I've been thinking that it is not a good approach since I think the header and footer will also load upon loading the said section
Reply


Messages In This Thread
Change the main content per controller change - by nullstrike - 07-29-2017, 07:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB