Welcome Guest, Not a member yet? Register   Sign In
Call a variable outide a different class
#5

[eluser]Otemu[/eluser]
Hi,

Quote:@Otemu That won’t work (LuckyFella73)
Yes you are correct thanks for pointing out my error. You can use my updated code below:

Code:
class MyOwnClass extends anotherClass{
  function  __construct() {
  parent::__construct();
  $CI =& get_instance();
  $this->getUsername = $this->session->userdata('username');
}

public function method1()
{
  echo $this->getUsername;
}

public function method2()
{
   echo $this->getUsername;
}
}


Messages In This Thread
Call a variable outide a different class - by El Forum - 02-19-2013, 11:22 PM
Call a variable outide a different class - by El Forum - 02-20-2013, 03:55 AM
Call a variable outide a different class - by El Forum - 02-20-2013, 04:37 AM
Call a variable outide a different class - by El Forum - 02-21-2013, 03:49 AM
Call a variable outide a different class - by El Forum - 02-21-2013, 04:58 AM
Call a variable outide a different class - by El Forum - 02-21-2013, 10:41 AM
Call a variable outide a different class - by El Forum - 02-22-2013, 02:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB