class Template extends Blitz {
public function __call($name, $row) {
if (!empty(self::$functions[$name])) {
return call_user_func_array(self::$functions[$name], $row);
} else {
throw new systemException("Вызов не существующей функции: ".$name);
}
}
public static function addFunction($name, $call) {
self::$functions[$name] = $call;
}
}
class Users {
public function __construct() {
Template::addFunction('getNameUser', array($this, 'getName'))
}
public function getName() {
return $this->name;
}
}