\BHB::$obj
If we have created an obj using:
<?php \BHB::$load->f('greet\model\testobj', 'nameOfObj');
we may call this obj in any point of our files writing:
<?php \BHB::obj('nameOfObj'); //we may store it in a var $var = \BHB::obj('nameOfObj'); //we may call a method, too. $returnedByF1 = \BHB::obj('nameOfObject')->f1(); //or do a clone, to keep separated them. $var2 = clone $var;
Lets we test more:
<?php $one = \BHB::$load->f('greet\model\testobj', 'objOne'); print "gettype(\$one) == ".gettype($one)."<br />"; //prints object print "gettype( \BHB::obj('objOne') ) == ".gettype( \BHB::obj('objOne') )."<br /><br />"; //prints object $two = \BHB::$load->f('greet\model\testobj', 'objTwo'); print "\$two = \BHB::$load->f('greet\model\testobj', 'objTwo');<br /><br />"; \BHB::obj('objOne')->f1(5); print "\BHB::obj('objOne')->var == ".\BHB::obj('objOne')->var." (should be 5.)<br />"; print "\$one->var == ".$one->var." (should be 5, too.)<br /><br />"; print "\$two->f1() = ".$two->f1()." (should be 0.)<br /><br />";