Welcome Guest, Not a member yet? Register   Sign In
HMVC two modules passing the same variable name to their views and causing conflict
#2

[eluser]CroNiX[/eluser]
Not sure if it would be helpful here, but you can use $this->load->vars($data_array) and make those globally available to all views. Doing that, you don't have to explicitly pass the data to the view.

Code:
$data['page_title'] = 'page title';
$this->load->vars($data);
$this->load->view('view_file');  //Don't need to pass $data

You can then also use $this->load->get_var($key) to see if it exists.

More info in the User Guide for the Loader class

You could also try not assigning both as 'content' and use 2 different keys for it. $data['module1_content'], $data['module2_content'], etc., so they don't override each other.


Messages In This Thread
HMVC two modules passing the same variable name to their views and causing conflict - by El Forum - 06-07-2012, 11:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB