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

[eluser]ggoforth[/eluser]
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:

Code:
//your controller
<?
     class Myclass extends Controller{
          function __construct(){
              parent::Controller();
          }
          function index(){
              $data['welcome_msg'] = array('welcome'=>'my welcome message goes here');
              $this->load->view('my_view',$data);
          }
     }
?>

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

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

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


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