本文整理汇总了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();
}
示例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');
}
}
示例3: events
/**
* @inheritDoc
*/
public function events()
{
return ArrayHelper::merge(parent::events(), [ActiveRecord::EVENT_AFTER_UPDATE => [$this, 'onAfterUpdate'], ActiveRecord::EVENT_AFTER_FIND => [$this, 'onAfterFind']]);
}
示例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'));
}
示例5: events
/**
* @inheritdoc
*/
public function events()
{
return array_merge(parent::events(), [ActiveRecord::EVENT_AFTER_FIND => 'setLanguage']);
}
示例6: events
public function events()
{
$events = parent::events();
$events[\yii\base\Application::EVENT_BEFORE_REQUEST] = 'beforeRequest';
return $events;
}
示例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');
}
示例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']);
}
示例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']);
}
示例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'));
}