By Jostein Rosenlund on Saturday, 21 December 2013
Posted in General Issues
Replies 3
Likes 0
Views 899
Votes 0
How can I transfere data from 1 model to another? or from a view to an model?

like if i do $value = "1" in view.html.php

and i want to echo $value in /models/model.php

or if i want to pass $data from

/models/model1.php

to

/model/models2.php
Hello Jostein,

You need to pass in as a function argument to the model's function
·
Saturday, 21 December 2013 13:01
·
0 Likes
·
0 Votes
·
0 Comments
·
can you give me an example?
·
Saturday, 21 December 2013 13:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Not sure what example you want but typically, you can pass a function with an argument in php,



function hello( $var )
{
echo $var;
}

$value = 'hello';
hello( $value );
·
Sunday, 22 December 2013 20:10
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post