Welcome Guest, Not a member yet? Register   Sign In
Passing data to/from models
#2

[eluser]Tom Schlick[/eluser]
Code:
$data = $this->test_model->testify($data);

no quotes in parameters
and your model function has to be like so

Code:
function testify($data)
    {
        //change point1 of data
        $data['point1'] = "I do not like green eggs and ham!";
        
        //echo data to see if it has the complete array or just
        //the new point1
        echo "model data:".'<pre>';
        print_r($data);
        echo '</pre>';
        return $data;
    }
notice the data variable in the parameters of the function

you have to assign the vairable data to the returned information from the model.


Messages In This Thread
Passing data to/from models - by El Forum - 04-01-2009, 12:52 PM
Passing data to/from models - by El Forum - 04-01-2009, 12:56 PM
Passing data to/from models - by El Forum - 04-01-2009, 01:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB