Welcome Guest, Not a member yet? Register   Sign In
Clean way to work with views
#1

[eluser]jfong[/eluser]
Hi,

Great framework and I'm really learning fast - just trying to learn how to do this properly. I have a function to get everything from the db in the model, which passes to controller as a $data array. In the controller, I am assigning it as follows:

$data['everything'] = $this->Everything_model->everything();

and passing $data to the view. In the view, I do:

foreach ($everything as $row) {
echo $row['recordname'];
}

I can get everything to show properly, however I feel like I can somehow do all the processing in the controller, then use something like a variable $recordname in the view. Is this possible by assigning a variable in the controller like $recordname = $data['everything']? Or, do I have to keep the data as an array then expand it in the view?

Any help would be appreciated! Thank you!


Messages In This Thread
Clean way to work with views - by El Forum - 10-16-2010, 08:51 PM
Clean way to work with views - by El Forum - 10-17-2010, 01:41 AM
Clean way to work with views - by El Forum - 10-17-2010, 07:35 AM
Clean way to work with views - by El Forum - 10-17-2010, 07:39 AM
Clean way to work with views - by El Forum - 10-17-2010, 10:26 AM
Clean way to work with views - by El Forum - 10-18-2010, 10:46 AM
Clean way to work with views - by El Forum - 10-18-2010, 11:21 AM
Clean way to work with views - by El Forum - 10-18-2010, 05:42 PM
Clean way to work with views - by El Forum - 10-22-2010, 09:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB