Welcome Guest, Not a member yet? Register   Sign In
[Q] another loading views from DB
#4

[eluser]hvalente13[/eluser]
Quote:or may be what you meant is that my view.php would just have
a one line something like

my_simple_view.php

<?php echo $my_view_data;?>

and then I would just do

$data[’my_view_data’] =my_db.get_view_mockup_from_db();
$this->load->view(’my_simple_view’,$data);

?

Yes... that's it! You have to pass the info from controller to the view via an array! Simple as that.

Of course you can instantiate any var in your view and work with it, but in this case what's the point of MVC architecture? I only do that for some counter vars to determine if it's odd or even... For the rest I work all data in my models -> controllers.

Hope this helps.

Good luck


Messages In This Thread
[Q] another loading views from DB - by El Forum - 07-16-2008, 04:51 AM
[Q] another loading views from DB - by El Forum - 07-16-2008, 08:30 AM
[Q] another loading views from DB - by El Forum - 07-18-2008, 06:26 PM
[Q] another loading views from DB - by El Forum - 07-19-2008, 10:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB