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


PHP Dispatcher::subscribe方法代碼示例

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


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

示例1: listen

 public function listen(Dispatcher $events)
 {
     $events->subscribe('Flarum\\Lock\\Listeners\\AddClientAssets');
     $events->subscribe('Flarum\\Lock\\Listeners\\AddApiAttributes');
     $events->subscribe('Flarum\\Lock\\Listeners\\PersistData');
     $events->subscribe('Flarum\\Lock\\Listeners\\NotifyDiscussionLocked');
     $events->subscribe('Flarum\\Lock\\Listeners\\ConfigurePermissions');
 }
開發者ID:redstarxz,項目名稱:flarumone,代碼行數:8,代碼來源:Extension.php

示例2: listen

 public function listen(Dispatcher $events)
 {
     $events->subscribe('Flarum\\Tags\\Listeners\\AddClientAssets');
     $events->subscribe('Flarum\\Tags\\Listeners\\AddModelRelationship');
     $events->subscribe('Flarum\\Tags\\Listeners\\ConfigureDiscussionPermissions');
     $events->subscribe('Flarum\\Tags\\Listeners\\ConfigureTagPermissions');
     $events->subscribe('Flarum\\Tags\\Listeners\\AddApiAttributes');
     $events->subscribe('Flarum\\Tags\\Listeners\\PersistData');
     $events->subscribe('Flarum\\Tags\\Listeners\\LogDiscussionTagged');
     $events->subscribe('Flarum\\Tags\\Listeners\\UpdateTagMetadata');
     $events->subscribe('Flarum\\Tags\\Listeners\\AddTagGambit');
 }
開發者ID:redstarxz,項目名稱:flarumone,代碼行數:12,代碼來源:Extension.php

示例3: listen

 public function listen(Dispatcher $events)
 {
     $events->subscribe('S12g\\ImageAttachments\\Listeners\\AddClientAssets');
     $events->listen(RegisterApiRoutes::class, function (RegisterApiRoutes $event) {
         $event->post('/s12g/image_attachments', 's12g.imageattachments.upload', 'S12g\\ImageAttachments\\UploadAction');
     });
 }
開發者ID:stoensin,項目名稱:flarumone,代碼行數:7,代碼來源:Extension.php

示例4: __construct

 /**
  * @param CommentForm  $commentForm
  * @param Dispatcher   $events
  */
 public function __construct(CommentForm $commentForm, Dispatcher $events)
 {
     $this->beforeFilter('auth', ['only' => ['update', 'trash', 'approve']]);
     $this->commentForm = $commentForm;
     $events->subscribe('FIIP\\Comments\\CommentEventHandler');
     Comments::setDispatcher($events);
 }
開發者ID:adriancatalinsv,項目名稱:fiip,代碼行數:11,代碼來源:CommentsController.php

示例5: boot

 /**
  * Bootstrap the application services.
  * @param Dispatcher $dispatcher
  */
 public function boot(Dispatcher $dispatcher)
 {
     // Merge config
     $this->mergeConfigFrom(base_path('vendor/aginev/login-activity/config/login-activity.php'), 'login-activity');
     // Publish config
     $this->publishes([base_path('vendor/aginev/login-activity/config/login-activity.php') => config_path('login-activity.php')], 'config');
     // Publish migrations
     $this->publishes([base_path('vendor/aginev/login-activity/migrations/create_user_login_activities_table.php') => database_path('/migrations/' . date('Y_m_d_His', time()) . '_create_user_login_activities_table.php')], 'migrations');
     // Register event subscriber
     $dispatcher->subscribe(LoginActivityListener::class);
 }
開發者ID:aginev,項目名稱:login-activity,代碼行數:15,代碼來源:LoginActivityServiceProvider.php

示例6: listen

 public function listen(Dispatcher $events)
 {
     $events->subscribe('Flarum\\Mentions\\Listeners\\AddClientAssets');
     $events->subscribe('Flarum\\Mentions\\Listeners\\AddModelRelationships');
     $events->subscribe('Flarum\\Mentions\\Listeners\\AddApiRelationships');
     $events->subscribe('Flarum\\Mentions\\Listeners\\AddUserMentionsFormatter');
     $events->subscribe('Flarum\\Mentions\\Listeners\\AddPostMentionsFormatter');
     $events->subscribe('Flarum\\Mentions\\Listeners\\UpdateUserMentionsMetadata');
     $events->subscribe('Flarum\\Mentions\\Listeners\\UpdatePostMentionsMetadata');
 }
開發者ID:redstarxz,項目名稱:flarumone,代碼行數:10,代碼來源:Extension.php

示例7: makeDispatcher

 /**
  * Setup and boot EventDispatcher.
  *
  * @return  \Illuminate\Contracts\Events\Dispatcher
  */
 protected function makeDispatcher()
 {
     $events = new Dispatcher();
     foreach ($this->listen as $event => $listeners) {
         foreach ($listeners as $listener) {
             $events->listen($event, $listener);
         }
     }
     foreach ($this->subscribe as $subscriber) {
         $events->subscribe($subscriber);
     }
     return $events;
 }
開發者ID:bvqbao,項目名稱:app-skeleton,代碼行數:18,代碼來源:EventServiceProvider.php

示例8: listen

 public function listen(Dispatcher $events)
 {
     $events->subscribe(Listeners\AddTranslateJs::class);
 }
開發者ID:hyn,項目名稱:flarum-google-translate,代碼行數:4,代碼來源:Extension.php

示例9: listen

 public function listen(Dispatcher $events)
 {
     $events->subscribe('Flarum\\Markdown\\Listeners\\AddClientAssets');
     $events->subscribe('Flarum\\Markdown\\Listeners\\AddMarkdownFormatter');
 }
開發者ID:redstarxz,項目名稱:flarumone,代碼行數:5,代碼來源:Extension.php

示例10: listen

 public function listen(Dispatcher $events)
 {
     $events->subscribe('S12g\\NoSlug\\Listeners\\AddClientAssets');
 }
開發者ID:redstarxz,項目名稱:flarumone,代碼行數:4,代碼來源:Extension.php

示例11: listen

 public function listen(Dispatcher $events)
 {
     $events->subscribe(__NAMESPACE__ . '\\Listener');
 }
開發者ID:redstarxz,項目名稱:flarumone,代碼行數:4,代碼來源:bootstrap.php

示例12: listen

 public function listen(Dispatcher $events)
 {
     $events->subscribe('Flarum\\Suspend\\Listeners\\AddClientAssets');
     $events->subscribe('Flarum\\Suspend\\Listeners\\AddApiAttributes');
     $events->subscribe('Flarum\\Suspend\\Listeners\\PersistData');
 }
開發者ID:redstarxz,項目名稱:flarumone,代碼行數:6,代碼來源:Extension.php

示例13: subscribe

 /**
  * Register an event subscriber with the dispatcher.
  *
  * @param object|string $subscriber
  * @return void 
  * @static 
  */
 public static function subscribe($subscriber)
 {
     \Illuminate\Events\Dispatcher::subscribe($subscriber);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:11,代碼來源:_ide_helper.php


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