Welcome Guest, Not a member yet? Register   Sign In
access variable from different method within same model
#2

[eluser]umefarooq[/eluser]
yes you can access with in model class just you have to define variable at class level

Code:
class Holiday_model  extends Model{
public $id;
public $var;

  function get_function(){
    $this->id;
  }

  function get_function2(){
   $this->id;
   $this->var;
  }
}

in controller you can access these variables also because these are defined public

$this->Holiday_model->id = 1;


Messages In This Thread
access variable from different method within same model - by El Forum - 11-05-2009, 03:35 AM
access variable from different method within same model - by El Forum - 11-05-2009, 03:51 AM
access variable from different method within same model - by El Forum - 11-05-2009, 04:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB