当前位置: 首页>>代码示例>>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;未经允许,请勿转载。