Welcome Guest, Not a member yet? Register   Sign In
Cannot pass variables from Controller to Model
#4

$this refers to the current object context.

Inside your model, $this->test_message should refer to a model property, not a controller one.

If you want to reference controller properties inside a model (not that this is a good idea), you would use something like

$CI = &get_instance();
... $CI->test_message

Without seeing more of your project, I cannot guess at why your code might have worked as described in CI2.

Your problem is *not* a bug ... CI was not intended to be used the way you have described.
Reply


Messages In This Thread
RE: Cannot pass variables from Controller to Model - by ciadmin - 05-29-2016, 08:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB