Cannot pass variables from Controller to Model |
Public controller properties can be accessed within model context in the way $this->test_message , "magic" is used for this. But I don't use this feature for passing values, it is handy for accessing objects that the controller contains. Within a model you can write $value = $this->session->userdata('value'); instead of $CI = &get_instance(); $value = $CI->session->userdata('value');
Anyway, if you want to pass to the controller a property value (don't like this), better declare it within the corresponding controller public $test_message; [] |
Messages In This Thread |
Cannot pass variables from Controller to Model - by allenlee - 05-29-2016, 06:54 AM
RE: Cannot pass variables from Controller to Model - by Tpojka - 05-29-2016, 08:30 AM
RE: Cannot pass variables from Controller to Model - by skunkbad - 05-29-2016, 08:42 AM
RE: Cannot pass variables from Controller to Model - by ciadmin - 05-29-2016, 08:48 AM
RE: Cannot pass variables from Controller to Model - by PaulD - 05-29-2016, 09:24 AM
RE: Cannot pass variables from Controller to Model - by allenlee - 05-29-2016, 10:55 AM
RE: Cannot pass variables from Controller to Model - by albertleao - 05-29-2016, 10:57 AM
RE: Cannot pass variables from Controller to Model - by ivantcholakov - 05-29-2016, 12:25 PM
RE: Cannot pass variables from Controller to Model - by Narf - 05-30-2016, 04:34 AM
RE: Cannot pass variables from Controller to Model - by spjonez - 06-01-2016, 05:55 AM
|