Welcome Guest, Not a member yet? Register   Sign In
Global functions
#12

[eluser]mddd[/eluser]
If you use $CI in one method, it is not set in another method! You need to make a class property $CI and, in your methods, refer to it as $this->CI.

Code:
class Location
{
   var $CI;

  function __construct()
  {
    $this->CI =& get_instance();
  }

  function other_function()
  {
    // use $this->CI here
  }
}


Messages In This Thread
Global functions - by El Forum - 08-18-2010, 09:02 PM
Global functions - by El Forum - 08-18-2010, 11:44 PM
Global functions - by El Forum - 08-19-2010, 12:15 AM
Global functions - by El Forum - 08-19-2010, 07:30 AM
Global functions - by El Forum - 08-19-2010, 07:37 AM
Global functions - by El Forum - 08-19-2010, 07:45 AM
Global functions - by El Forum - 08-19-2010, 07:55 AM
Global functions - by El Forum - 08-19-2010, 08:31 AM
Global functions - by El Forum - 08-19-2010, 10:04 AM
Global functions - by El Forum - 08-19-2010, 10:27 AM
Global functions - by El Forum - 08-19-2010, 10:29 AM
Global functions - by El Forum - 08-19-2010, 10:39 AM
Global functions - by El Forum - 08-19-2010, 10:43 AM
Global functions - by El Forum - 08-30-2010, 11:06 AM
Global functions - by El Forum - 08-30-2010, 01:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB