Observable properties and methods - Examples

These features are provided by xms_overload, so all classes extending it will have the same functionality
$obj -> testProperty = "SOME VAL";

$obj -> bind("change", "testProperty", function($value, $oldValue) {
	//DO SOMETHING
}) -> bind("change", "testProperty", function($value, $oldValue) {
	//DO SOMETHING ELSE
});

$obj -> testMethod = function($argv1, $argv2) {
};

$obj -> bind("before", "testMethod", function($argv1, $argv2) {
	//DO SOMETHING
	//$this is $obj
}) -> bind("after", "testMethod", function($argv1, $argv2) {
	//DO SOMETHING
	//$this is $obj
}) -> bind("after", "testMethod", function($argv1, $argv2) {
	//DO SOMETHING ELSE
	//$this is $obj
});

$obj -> testMethod("Value1", "Value2");

Showing 5 from 0 out of

No comments
Showing 5 from 0 out of