Welcome Guest, Not a member yet? Register   Sign In
Passing data from on view to another ?
#1

[eluser]HooJee[/eluser]
Hi Guys

Is it possible to set a variable in one view and forward it to another? I tried to no avail. Below is my source code:

Code:
// view1.php
<?php
    $message = "No Projects Found";
    $this->load->view('ajax/infoBox', $message);
?>

//infoBox.php
<?php echo $message; ?>

The above gives me an error that the var message cannot be foundd.
#2

[eluser]Dam1an[/eluser]
you always need to pass variables into a view as an array, try
Code:
$this->load->view('ajax/infoBox', array('message'=>$message));




Theme © iAndrew 2016 - Forum software by © MyBB