Welcome Guest, Not a member yet? Register   Sign In
General model questions
#5

[eluser]jimps[/eluser]
[quote author="Buso" date="1277778441"]you can communicate with the codeigniter object with get_instance()

Code:
function some_model_method() {

  // something went wrong

  $CI =& get_instance();
  $CI->add_errors('Wrong Password!');

  return FALSE;
}

I usually save that reference in $this->CI inside __construct(), as I'm always using the CI object. If it's just one call you can do it like this: get_instance()->some_method();[/quote]

Ah, now i understand! That's pretty good, thank you. Big Grin


Messages In This Thread
General model questions - by El Forum - 06-28-2010, 01:58 PM
General model questions - by El Forum - 06-28-2010, 03:05 PM
General model questions - by El Forum - 06-28-2010, 03:12 PM
General model questions - by El Forum - 06-28-2010, 03:27 PM
General model questions - by El Forum - 06-28-2010, 03:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB