Let's say i have the following behavior and standard class:
abstract class MyBehavior {
function testFunction(){
return 'test';
}
}
class TestClass {
var $use = array('MyBehavior');
function __construct(){
// do something to give me access to function testFunction through
// $this->testFunction();
}
}
$test = new TestClass();
As i commented, i would like the MyBehavior method to be available inside TestClass ($test->testFunction();) without "extending" the class...
Is this possible?
EDIT: Thanks for all the responses, I have my answer, or at least i need to know what my options are, so thanks! I can only give one right answer, so I'm going with the first response.