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


PHP Behavior::events方法代碼示例

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


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

示例1: events

 public function events()
 {
     $owner = $this->owner;
     if ($owner instanceof Controller) {
         return [$owner::EVENT_BEFORE_ACTION => '', $owner::EVENT_AFTER_ACTION => ''];
     }
     return parent::events();
 }
開發者ID:sydorenkovd,項目名稱:yiiadv,代碼行數:8,代碼來源:AccessOnce.php

示例2: events

 /**
  * Declares event handlers for the [[owner]]'s events.
  * @return array
  */
 public function events()
 {
     parent::events();
     if (!$this->_hasEventHandlers) {
         return array_fill_keys($this->events, 'postDeferredEvent');
     } else {
         return array_fill_keys(array_keys($this->events), 'postDeferredEvent');
     }
 }
開發者ID:voodoo-mobile,項目名稱:yii2-queue,代碼行數:13,代碼來源:DeferredEventBehavior.php

示例3: events

 /**
  * @inheritDoc
  */
 public function events()
 {
     return ArrayHelper::merge(parent::events(), [ActiveRecord::EVENT_AFTER_UPDATE => [$this, 'onAfterUpdate'], ActiveRecord::EVENT_AFTER_FIND => [$this, 'onAfterFind']]);
 }
開發者ID:nanodesu88,項目名稱:yii2-activerecord-attributes,代碼行數:7,代碼來源:AttributesBehavior.php

示例4: events

 /**
  * Declares events and the corresponding event handler methods.
  * If you override this method, make sure you merge the parent result to the return value.
  * @return array events (array keys) and the corresponding event handler methods (array values).
  * @see CBehavior::events
  */
 public function events()
 {
     return array_merge(parent::events(), array(Controller::EVENT_BEFORE_ACTION => 'beforeAction', Controller::EVENT_AFTER_ACTION => 'afterAction'));
 }
開發者ID:yiicod,項目名稱:yii2-cron,代碼行數:10,代碼來源:LockUnLockBehavior.php

示例5: events

 /**
  * @inheritdoc
  */
 public function events()
 {
     return array_merge(parent::events(), [ActiveRecord::EVENT_AFTER_FIND => 'setLanguage']);
 }
開發者ID:legion-spb,項目名稱:yii2-skeleton,代碼行數:7,代碼來源:LanguageDetectBehavior.php

示例6: events

 public function events()
 {
     $events = parent::events();
     $events[\yii\base\Application::EVENT_BEFORE_REQUEST] = 'beforeRequest';
     return $events;
 }
開發者ID:bennybi,項目名稱:yii2-cza-base,代碼行數:6,代碼來源:AppConfigBehavior.php

示例7: events

 /**
  * Declares event handlers for the [[owner]]'s events.
  * @return array
  */
 public function events()
 {
     parent::events();
     return array_fill_keys(array_keys($this->events), 'routeEvent');
 }
開發者ID:mrlco,項目名稱:yii2-queue,代碼行數:9,代碼來源:DeferredEventRoutingBehavior.php

示例8: events

 /**
  * @inheritdoc
  */
 public function events()
 {
     return array_merge(parent::events(), [BaseActiveRecord::EVENT_BEFORE_VALIDATE => 'resolveSecureAttributesChanged', BaseActiveRecord::EVENT_BEFORE_INSERT => 'resolveConflicts', BaseActiveRecord::EVENT_AFTER_INSERT => 'createSecureItem', BaseActiveRecord::EVENT_AFTER_UPDATE => 'updateSecureItem', BaseActiveRecord::EVENT_AFTER_DELETE => 'deleteSecureItem']);
 }
開發者ID:yii2-tools,項目名稱:yii2-secure-ar,代碼行數:7,代碼來源:SecureBehavior.php

示例9: events

 /**
  * @inheritdoc
  */
 public function events()
 {
     return array_merge(parent::events(), ['init' => 'afterInit', 'beforeValidate' => 'beforeValidate', 'afterValidate' => 'afterValidate', 'afterFind' => 'afterFind', 'beforeInsert' => 'beforeInsert', 'afterInsert' => 'afterInsert', 'beforeUpdate' => 'beforeUpdate', 'afterUpdate' => 'afterUpdate', 'beforeDelete' => 'beforeDelete', 'afterDelete' => 'afterDelete']);
 }
開發者ID:alex-dwt,項目名稱:file,代碼行數:7,代碼來源:ModelBehavior.php

示例10: events

 /**
  * Declares events and the corresponding event handler methods.
  * If you override this method, make sure you merge the parent result to the return value.
  * @return array events (array keys) and the corresponding event handler methods (array values).
  * @see CBehavior::events
  */
 public function events()
 {
     return array_merge(parent::events(), array('beforeLogin' => 'beforeLogin', 'beforeSignup' => 'beforeSignup', 'beforeRequestPasswordReset' => 'beforeRequestPasswordReset', 'beforeResetPassword' => 'beforeResetPassword', 'beforeLogout' => 'beforeLogout', 'afterRequestPasswordReset' => 'afterRequestPasswordReset', 'afterResetPassword' => 'afterResetPassword', 'afterLogin' => 'afterLogin', 'afterSignup' => 'afterSignup', 'afterLogout' => 'afterLogout', 'errorResetPassword' => 'errorResetPassword', 'errorRequestPasswordReset' => 'errorRequestPasswordReset', 'errorLogin' => 'errorLogin', 'errorSignup' => 'errorSignup'));
 }
開發者ID:avrahamichler,項目名稱:Highnet,代碼行數:10,代碼來源:AuthBaseBehavior.php


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