标签:php
/** * Register an event listener with the dispatcher. * * @param string|array $events * @param mixed $listener * @param int $priority * @return void */ public function listen($events, $listener, $priority = 0) {// Register an event listener use dispathcer foreach ((array) $events as $event) {// loop this events as event if (Str::contains($event, ‘*‘)) {// determine this string is has this * char $this->setupWildcardListen($event, $listener);// if has this *, setup the wildcard listen } else {// ele $this->listeners[$event][$priority][] = $this->makeListener($listener);// make listener to event // this listener unset($this->sorted[$event]); // unset event } } }
本文出自 “专注php” 博客,请务必保留此出处http://jingshanls.blog.51cto.com/3357095/1790156
[李景山php]每天laravel-20160902|Dispatcher-2
标签:php
原文地址:http://jingshanls.blog.51cto.com/3357095/1790156