Welcome Guest, Not a member yet? Register   Sign In
How do you use a model's output...
#3

[eluser]nubianxp[/eluser]
[quote author="ggoforth" date="1238898068"]As far as I know (and I don't know all that much) you need to pass that piece of data to the view. So if your view is being loaded in by another view, you need to pass an array with your welcome message in your controller. It would look something like this:
...
That should accomplish what your trying to do. You can also load your footer into a variable within your controller and then just echo it out, but I was try to stay on track with what your already doing. Either way is fine in my opinion, as long as it makes it easier for you to keep track of.

Greg[/quote]

Thanks, I think I missed this one:

Code:
//your first view
<?
     //load the footer
     $this->load->view('footer',$welcome_msg);
?>

//your footer
<?
     <?=$welcome?>
?>

cool, will try that out.
BTW, do I need to place this:
Code:
$data['welcome_msg'] = array('welcome'=>'my welcome message goes here');
on all my controllers or just the main one?

Thanks again.


Messages In This Thread
How do you use a model's output... - by El Forum - 04-04-2009, 02:14 PM
How do you use a model's output... - by El Forum - 04-04-2009, 03:21 PM
How do you use a model's output... - by El Forum - 04-04-2009, 03:29 PM
How do you use a model's output... - by El Forum - 04-04-2009, 03:37 PM
How do you use a model's output... - by El Forum - 04-04-2009, 04:03 PM
How do you use a model's output... - by El Forum - 04-05-2009, 02:06 AM
How do you use a model's output... - by El Forum - 04-05-2009, 10:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB