/** * 魔术方法 */ public function __call($method, $args) { if (mb_substr($method, 0, 2) === 'on') { $eventName = ucfirst(ltrim($method, 'on')); if (Event::isValid($eventName) && !empty($args)) { $this->on($eventName, $args[0]); } } return $this; }
/** * 魔术方法 */ public function __call($method, $args) { if (mb_substr($method, 0, 2) === 'on') { $eventName = ucfirst(ltrim($method, 'on')); if (Event::isValid($eventName) && !empty($args)) { $this->on($eventName, $args[0]); } } return $this; }