[eluser]Unknown[/eluser]
Hi Everybody,
New to CodeIgniter and would love some clarification about best practices about passing data from the controller to multiple views.
I've queried some rows from a table and it's stored in a $data variable (following nettuts tutorials). The data holds information for all the columns. It's passed into the view like this:
Code:
$this->load->view('feature_quote', $data);
$this->load->view('page_content', $data);
My question is if passing the same $data variable into multiple views is inefficient since some of the data isn't being used. Should my controller for instance query specific columns instead so we're passing specific data into each view like below.
Code:
$this->load->view('feature_quote', $quote);
$this->load->view('page_content', $data);
Thanks in advance and sorry if this is a noob question.
Cheers,
Mike