本文整理汇总了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');
}
示例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');
}
示例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');
});
}
示例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);
}
示例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);
}
示例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');
}
示例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;
}
示例8: listen
public function listen(Dispatcher $events)
{
$events->subscribe(Listeners\AddTranslateJs::class);
}
示例9: listen
public function listen(Dispatcher $events)
{
$events->subscribe('Flarum\\Markdown\\Listeners\\AddClientAssets');
$events->subscribe('Flarum\\Markdown\\Listeners\\AddMarkdownFormatter');
}
示例10: listen
public function listen(Dispatcher $events)
{
$events->subscribe('S12g\\NoSlug\\Listeners\\AddClientAssets');
}
示例11: listen
public function listen(Dispatcher $events)
{
$events->subscribe(__NAMESPACE__ . '\\Listener');
}
示例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');
}
示例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);
}