当前位置: 首页>>代码示例>>PHP>>正文


PHP Event::subscribe方法代码示例

本文整理汇总了PHP中Event::subscribe方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::subscribe方法的具体用法?PHP Event::subscribe怎么用?PHP Event::subscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Event的用法示例。


在下文中一共展示了Event::subscribe方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: registerSubscriber

 /**
  * イベントハンドラーをSubscriberに登録
  */
 protected function registerSubscriber()
 {
     // メール送信イベントハンドラー
     if (config('notification.enabled')) {
         \Event::subscribe('\\Owl\\Handlers\\Events\\EmailNotification');
     }
 }
开发者ID:so1,项目名称:owl,代码行数:10,代码来源:EventServiceProvider.php

示例2: register

 public function register()
 {
     \Event::subscribe('Cms\\Events\\Crud\\PublicViewsEventHandler');
     \Event::subscribe('Cms\\Events\\Crud\\PublicRoutesEventHandler');
     \Event::subscribe('Cms\\Events\\Crud\\EntitiesEventHandler');
     \Event::subscribe('Cms\\Events\\Crud\\EntityAttributesEventHandler');
 }
开发者ID:joadr,项目名称:cms,代码行数:7,代码来源:EventsServiceProvider.php

示例3: register

 public function register()
 {
     $subscriber = new EventDetrSendMailSubcriber();
     \Event::subscribe($subscriber);
     //hoặc code ở dứoi
     // $this->app->events->subscribe(new EventDetrSendMailSubcriber);
 }
开发者ID:anhtuanssp,项目名称:createyourown_vn_inqua,代码行数:7,代码来源:EventServiceProvider.php

示例4: register

 public function register()
 {
     if (!config('df.standalone')) {
         if (!class_exists(ManagedServiceProvider::class)) {
             throw new NotImplementedException('Package not installed. For non-standalone instance df-managed package is required.');
         }
         $this->app->register(ManagedServiceProvider::class);
     }
     $subscriber = new ServiceEventHandler();
     \Event::subscribe($subscriber);
 }
开发者ID:rajeshpillai,项目名称:df-core,代码行数:11,代码来源:DfServiceProvider.php

示例5: registerSubscriber

 /**
  * イベントハンドラーをSubscriberに登録
  */
 protected function registerSubscriber()
 {
     // メール送信イベントハンドラー
     if (config('notification.enabled')) {
         \Event::subscribe('\\Owl\\Handlers\\Events\\EmailNotification');
     }
     // Slack通知イベントハンドラー
     $slack_webhook_url = config('notification.slack.webhook_url');
     // for PHP <= 5.4
     if (config('notification.slack.enabled') && !empty($slack_webhook_url)) {
         \Event::subscribe('\\Owl\\Handlers\\Events\\SlackNotification');
     }
 }
开发者ID:owl,项目名称:owl,代码行数:16,代码来源:EventServiceProvider.php

示例6: handleUserLogin

 /**
  * Handling the post data from login form 
  * and checking authentication.
  * @return Response redirect
  */
 public function handleUserLogin()
 {
     // fetch the post data
     $postData = Input::all();
     // credentails array
     $credentials = array('email' => $postData['username'], 'password' => $postData['password']);
     // checking the authentication
     if (Auth::attempt($credentials)) {
         // Firing the login event
         $subscriber = new UserEventHandler();
         Event::subscribe($subscriber);
         $event = Event::fire('user.login', array(Auth::user()));
         // Redirect to dashboard
         return Redirect::intended('dashboard');
     } else {
         return Redirect::back();
     }
 }
开发者ID:sharad23,项目名称:learningl4,代码行数:23,代码来源:HomeController.php

示例7: handleUserAuthentication

 /**
  * This function is handling the post data from the login page.
  * 
  * @return mixed
  */
 public function handleUserAuthentication()
 {
     $username = Input::get('email');
     $password = Input::get('password');
     $SentryUser = new SentryUser();
     if ($SentryUser->authenticateUser($username, $password)) {
         SentryHelper::setMessage('Login successful', 'success');
         $user = Session::get('userObj');
         // getting the user object from session to pass to the event.
         /* firing the login event */
         $userSubscriber = new SentryuserEventHandler();
         Event::subscribe($userSubscriber);
         Event::fire('sentryuser.login', array($user));
         // user will be redirected to the configured dashboard.
         return Redirect::to($this->dashboard);
     } else {
         return Redirect::to('user');
     }
 }
开发者ID:l4mod,项目名称:sentryuser,代码行数:24,代码来源:UserController.php

示例8: array

});
/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenance mode is in effect for the application.
|
*/
App::down(function () {
    return Response::view('errors.503', array(), 503);
});
/*
|--------------------------------------------------------------------------
| Register Events Handlers
|--------------------------------------------------------------------------
*/
Event::subscribe('BestBant\\Handlers\\UserEventHandler');
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
开发者ID:anthrotech,项目名称:laravel_sample,代码行数:31,代码来源:global.php

示例9: array

                $similar[] = $budget->id;
            }
        }
        if (count($similar) > 0) {
            // get all transactions for these budgets:
            $amounts = array();
            $transactions = Auth::user()->transactions()->orderBy('date', 'DESC')->where('onetime', '=', 0)->whereIn('budget_id', $similar)->get();
            foreach ($transactions as $t) {
                $date = new Carbon($t->date);
                $day = intval($date->format('d'));
                $amounts[$day] = isset($amounts[$day]) ? $amounts[$day] + floatval($t->amount) * -1 : floatval($t->amount) * -1;
            }
            // then make sure it's "average".
            foreach ($amounts as $day => $amount) {
                // save as budget prediction point.
                $bpp = new Budgetpredictionpoint();
                $bpp->budget_id = $event->id;
                $bpp->amount = $amount / count($similar);
                $bpp->day = $day;
                $bpp->save();
            }
        }
    }
    public function subscribe($events)
    {
        $events->listen('eloquent.saved: Budget', 'BudgetEventHandler@updateBudgetPrediction');
    }
}
$BudgetHandler = new BudgetEventHandler();
Event::subscribe($BudgetHandler);
开发者ID:jcyh,项目名称:nder-firefly,代码行数:30,代码来源:BudgetEventHandler.php

示例10: function

<?php

/*
|--------------------------------------------------------------------------
| Event Handlers
|--------------------------------------------------------------------------
|
| Here is where you can register event handlers that subscribe to
| particular event types
|
*/
Event::subscribe('Zeropingheroes\\Lanager\\Domain\\Users\\UserHandler');
// Log all service actions
Event::listen('lanager.services.*', function ($parameters) {
    $eventName = str_replace('lanager.services.', '', Event::firing());
    $username = is_object(Auth::user()) ? Auth::user()->username : 'guest';
    Log::debug(e($username) . ': ' . $eventName, $parameters);
});
开发者ID:PoxyDoxy,项目名称:lanager,代码行数:18,代码来源:handlers.php

示例11: function

<?php

/**
 * This file is part of the Kodazzi Framework.
 *
 * (c) Jorge Gaitan <info@kodazzi.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/*
Event::listener('kernel.request', function ($event){

});
*/
Event::subscribe(new Listeners\ContactListener());
开发者ID:kodazzi,项目名称:kodazzi,代码行数:16,代码来源:listeners.cf.php

示例12: function

<?php

/**
 * This file is part of the Kodazzi Framework.
 *
 * (c) Jorge Gaitan <jgaitan@kodazzi.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/*
Event::listener('kernel.request', function ($event){

});
*/
Event::subscribe(new Listeners\ContactListener());
Event::subscribe(new Listeners\ShortcutsListener());
开发者ID:kodazzi,项目名称:amazonas,代码行数:17,代码来源:listeners.cf.php

示例13:

<?php

Event::subscribe('UserEventHandler');
开发者ID:urashima82,项目名称:intranet,代码行数:3,代码来源:events.php

示例14:

<?php

# USER EVENTS
Event::subscribe('App\\Events\\UserEvents');
开发者ID:xhoiyenx,项目名称:referral,代码行数:4,代码来源:events.php

示例15: register

 public function register()
 {
     $subscriber = new ServiceEventHandler();
     \Event::subscribe($subscriber);
 }
开发者ID:df-arif,项目名称:df-core,代码行数:5,代码来源:DfServiceProvider.php


注:本文中的Event::subscribe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。