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