CodeIgniter Forums
Inherit Function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Inherit Function (/showthread.php?tid=48219)



Inherit Function - El Forum - 01-08-2012

[eluser]Unknown[/eluser]
Hello guys I'm still newbie in CI, I want to ask how to make one function as parent so it can pass the variable and parameter to all function in one class.

example :

Code:
class Test extends CI_Controller{

var $a;

function testeR(){

$this->a = "test";


}

function testeZ(){


print_r($this->a);

}


}

Of course if I test run testeZ() it will no result, so... how to make testeZ() read testeR() function?