當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dispatcher::listen方法代碼示例

本文整理匯總了PHP中Illuminate\Events\Dispatcher::listen方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dispatcher::listen方法的具體用法?PHP Dispatcher::listen怎麽用?PHP Dispatcher::listen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Events\Dispatcher的用法示例。


在下文中一共展示了Dispatcher::listen方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: subscribe

 /**
  * Register the listeners for the subscriber.
  *
  * @param  \Illuminate\Events\Dispatcher  $events
  */
 public function subscribe($events)
 {
     $events->listen(\App\Events\Frontend\Auth\UserLoggedIn::class, 'App\\Listeners\\Frontend\\Auth\\UserEventListener@onLoggedIn');
     $events->listen(\App\Events\Frontend\Auth\UserLoggedOut::class, 'App\\Listeners\\Frontend\\Auth\\UserEventListener@onLoggedOut');
     $events->listen(\App\Events\Frontend\Auth\UserRegistered::class, 'App\\Listeners\\Frontend\\Auth\\UserEventListener@onRegistered');
     $events->listen(\App\Events\Frontend\Auth\UserConfirmed::class, 'App\\Listeners\\Frontend\\Auth\\UserEventListener@onConfirmed');
 }
開發者ID:blomdahldaniel,項目名稱:laravel-5-boilerplate,代碼行數:12,代碼來源:UserEventListener.php

示例2: subscribe

 /**
  * Register the listeners for the subscriber.
  *
  * @param \Illuminate\Events\Dispatcher $events
  * @return void
  */
 public function subscribe($events)
 {
     Recipe::observe('App\\Observers\\RecipeModelObserver');
     $events->listen('App\\Events\\Recipe\\RecipeCreated', 'App\\Listeners\\RecipeEventListener@onRecipeCreated');
     $events->listen('App\\Events\\Recipe\\RecipeUpdated', 'App\\Listeners\\RecipeEventListener@onRecipeUpdated');
     $events->listen('App\\Events\\Recipe\\RecipeDeleted', 'App\\Listeners\\RecipeEventListener@onRecipeDeleted');
 }
開發者ID:artissant,項目名稱:stock,代碼行數:13,代碼來源:RecipeEventListener.php

示例3: subscribe

 /**
  * Register the listeners for the subscriber.
  *
  * @param \Illuminate\Events\Dispatcher $events
  * @return void
  */
 public function subscribe($events)
 {
     Ingredient::observe('App\\Observers\\IngredientModelObserver');
     $events->listen('App\\Events\\Ingredient\\IngredientCreated', 'App\\Listeners\\IngredientEventListener@onIngredientCreated');
     $events->listen('App\\Events\\Ingredient\\IngredientUpdated', 'App\\Listeners\\IngredientEventListener@onIngredientUpdated');
     $events->listen('App\\Events\\Ingredient\\IngredientDeleted', 'App\\Listeners\\IngredientEventListener@onIngredientDeleted');
 }
開發者ID:artissant,項目名稱:stock,代碼行數:13,代碼來源:IngredientEventListener.php

示例4: subscribe

 /**
  * Register the listeners for the subscriber.
  *
  * @param  \Illuminate\Events\Dispatcher $events
  */
 public function subscribe($events)
 {
     $events->listen('cms\\Domain\\Users\\Users\\Events\\UserCreatedEvent', 'cms\\App\\Listeners\\UsersEventsListener@handleUserCreatedEvent');
     $events->listen('cms\\Domain\\Users\\Users\\Events\\UserUpdatedEvent', 'cms\\App\\Listeners\\UsersEventsListener@handleUserUpdatedEvent');
     $events->listen('cms\\Domain\\Users\\Users\\Events\\UserDeletedEvent', 'cms\\App\\Listeners\\UsersEventsListener@handleUserDeletedEvent');
     $events->listen('cms\\Domain\\Users\\Users\\Events\\NewUserRegisteredEvent', 'cms\\App\\Listeners\\UsersEventsListener@newUserRegisteredEvent');
 }
開發者ID:cvepdb-cms,項目名稱:module-users,代碼行數:12,代碼來源:UsersEventsListener.php

示例5: subscribe

 /**
  * Register the listeners for the subscriber.
  *
  * @param  \Illuminate\Events\Dispatcher  $events
  * @return array
  */
 public function subscribe($events)
 {
     $events->listen('App\\Form\\Customer\\Register', 'App\\Handlers\\Forms\\Customer\\AuthHandler@register', 10);
     $events->listen('App\\Form\\Customer\\Login', 'App\\Handlers\\Forms\\Customer\\AuthHandler@login', 10);
     $events->listen('App\\Form\\Customer\\ForgotPassword', 'App\\Handlers\\Forms\\Customer\\AuthHandler@forgot_password', 10);
     $events->listen('App\\Form\\Customer\\ResetPassword', 'App\\Handlers\\Forms\\Customer\\AuthHandler@reset_password', 10);
 }
開發者ID:BryceHappy,項目名稱:lavender,代碼行數:13,代碼來源:AuthHandler.php

示例6: subscribe

 /**
  * Listen to the events.
  *
  * @param  \Illuminate\Events\Dispatcher  $dispatcher
  * @return void
  */
 public function subscribe(Dispatcher $dispatcher)
 {
     $dispatcher->listen('cartalyst.cart.added', __CLASS__ . '@onItemAdded');
     $dispatcher->listen('cartalyst.cart.updated', __CLASS__ . '@onItemUpdated');
     $dispatcher->listen('cartalyst.cart.removed', __CLASS__ . '@onItemRemoved');
     $dispatcher->listen('cartalyst.cart.cleared', __CLASS__ . '@onCartCleared');
 }
開發者ID:Denniskevin,項目名稱:demo-cart,代碼行數:13,代碼來源:CartEventHandler.php

示例7: subscribe

 /**
  * Register the listeners for the subscriber.
  *
  * @param  \Illuminate\Events\Dispatcher  $events
  * @return array
  */
 public function subscribe($events)
 {
     $events->listen('auth.logout', 'App\\Handlers\\Events\\CartHandler@customer_logout');
     $events->listen('auth.login', 'App\\Handlers\\Events\\CartHandler@customer_login');
     $events->listen('App\\Events\\Cart\\Shipment\\CollectMethods', 'App\\Handlers\\Events\\CartHandler@shipment_methods');
     $events->listen('App\\Events\\Cart\\Payment\\CollectMethods', 'App\\Handlers\\Events\\CartHandler@payment_methods');
 }
開發者ID:BryceHappy,項目名稱:lavender,代碼行數:13,代碼來源:CartHandler.php

示例8: subscribe

 /**
  * {@inheritDoc}
  */
 public function subscribe(Dispatcher $dispatcher)
 {
     $dispatcher->listen('ocs.test.yyy.creating', __CLASS__ . '@creating');
     $dispatcher->listen('ocs.test.yyy.created', __CLASS__ . '@created');
     $dispatcher->listen('ocs.test.yyy.updating', __CLASS__ . '@updating');
     $dispatcher->listen('ocs.test.yyy.updated', __CLASS__ . '@updated');
     $dispatcher->listen('ocs.test.yyy.deleted', __CLASS__ . '@deleted');
 }
開發者ID:sohailaammarocs,項目名稱:lfc,代碼行數:11,代碼來源:YyyEventHandler.php

示例9: bind

 /**
  * Bind the given JavaScript to the view.
  *
  * @param string $js
  */
 public function bind($js)
 {
     foreach ($this->views as $view) {
         $this->event->listen("composing: {$view}", function () use($js) {
             echo "<script>{$js}</script>";
         });
     }
 }
開發者ID:richardwyke,項目名稱:PHP-Vars-To-Js-Transformer,代碼行數:13,代碼來源:LaravelViewBinder.php

示例10: subscribe

 /**
  * Event subscribe handler.
  *
  * @throws \Exception
  */
 public function subscribe()
 {
     $method = 'handle';
     if (method_exists($this, $getHandler = 'get' . Str::ucfirst($method) . 'r')) {
         $method = $this->{$getHandler}();
     }
     $this->events->listen($this->getEvent(), [$this, $method]);
 }
開發者ID:notadd,項目名稱:framework,代碼行數:13,代碼來源:EventSubscriber.php

示例11: subscribe

 /**
  * Map events and handlers
  *
  * @param Dispatcher $events
  */
 public function subscribe(Dispatcher $events)
 {
     $events->listen('UserHasLoggedIn', static::class . '@onUserHasLoggedIn');
     $events->listen('UserHasLoggedOut', static::class . '@onUserHasLoggedOut');
     $events->listen('NewUserRegistered', static::class . '@onNewUserRegistered');
     $events->listen('UserActivated', static::class . '@onUserActivated');
     $events->listen('UserHasCancelled', static::class . '@onUserDeleted');
 }
開發者ID:valdinei,項目名稱:rest,代碼行數:13,代碼來源:AuthEventListener.php

示例12: addHandlers

 /**
  * @param string $class
  * @param \Illuminate\Events\Dispatcher $events
  */
 protected function addHandlers(string $class, Dispatcher $events)
 {
     $baseName = class_basename($class);
     $created = 'eloquent.created: ' . $class;
     $events->listen($created, self::class . '@on' . $baseName . 'Create');
     $updated = 'eloquent.updated: ' . $class;
     $events->listen($updated, self::class . '@on' . $baseName . 'Edit');
 }
開發者ID:strimoid,項目名稱:strimoid,代碼行數:12,代碼來源:NotificationsHandler.php

示例13: subscribe

 /**
  * Register the listeners for the subscriber.
  *
  * @param  \Illuminate\Events\Dispatcher $events
  * @return array
  */
 public function subscribe($events)
 {
     $events->listen('sentinel.user.login', 'Sentinel\\Listeners\\UserEventListener@onUserLogin', 10);
     $events->listen('sentinel.user.logout', 'Sentinel\\Listeners\\UserEventListener@onUserLogout', 10);
     $events->listen('sentinel.user.registered', 'Sentinel\\Listeners\\UserEventListener@welcome', 10);
     $events->listen('sentinel.user.resend', 'Sentinel\\Listeners\\UserEventListener@welcome', 10);
     $events->listen('sentinel.user.reset', 'Sentinel\\Listeners\\UserEventListener@passwordReset', 10);
 }
開發者ID:johnhout,項目名稱:Sentinel,代碼行數:14,代碼來源:UserEventListener.php

示例14: subscribe

 /**
  * Register the listeners for the subscriber.
  *
  * @param  Illuminate\Events\Dispatcher  $events
  */
 public function subscribe(\Illuminate\Events\Dispatcher $events)
 {
     $class = 'Nasqueron\\Notifications\\Listeners\\NotificationListener';
     $events->listen('Nasqueron\\Notifications\\Events\\DockerHubPayloadEvent', "{$class}@onDockerHubPayload");
     $events->listen('Nasqueron\\Notifications\\Events\\GitHubPayloadEvent', "{$class}@onGitHubPayload");
     $events->listen('Nasqueron\\Notifications\\Events\\JenkinsPayloadEvent', "{$class}@onJenkinsPayload");
     $events->listen('Nasqueron\\Notifications\\Events\\PhabricatorPayloadEvent', "{$class}@onPhabricatorPayload");
 }
開發者ID:nasqueron,項目名稱:notifications,代碼行數:13,代碼來源:NotificationListener.php

示例15: subscribe

 /**
  * Register the listeners for the subscriber.
  *
  * @param \Illuminate\Events\Dispatcher $events
  *
  * @return void
  */
 public function subscribe(Dispatcher $events)
 {
     $events->listen('navigation.main', 'App\\Subscribers\\NavigationSubscriber@onNavigationMainFirst', 8);
     $events->listen('navigation.main', 'App\\Subscribers\\NavigationSubscriber@onNavigationMainSecond', 5);
     $events->listen('navigation.main', 'App\\Subscribers\\NavigationSubscriber@onNavigationMainThird', 2);
     $events->listen('navigation.bar', 'App\\Subscribers\\NavigationSubscriber@onNavigationBarFirst', 8);
     $events->listen('navigation.bar', 'App\\Subscribers\\NavigationSubscriber@onNavigationBarSecond', 5);
     $events->listen('navigation.bar', 'App\\Subscribers\\NavigationSubscriber@onNavigationBarThird', 2);
 }
開發者ID:xhulioh25,項目名稱:wiki,代碼行數:16,代碼來源:NavigationSubscriber.php


注:本文中的Illuminate\Events\Dispatcher::listen方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。