本文整理汇总了PHP中Cake\Controller\Component::implementedEvents方法的典型用法代码示例。如果您正苦于以下问题:PHP Component::implementedEvents方法的具体用法?PHP Component::implementedEvents怎么用?PHP Component::implementedEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Controller\Component
的用法示例。
在下文中一共展示了Component::implementedEvents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: implementedEvents
/**
* implementedEvents
*
* Lists all defined events.
*
* @return array
*/
public function implementedEvents()
{
return $_events = parent::implementedEvents();
$events = ['Controller.Users.afterRegister' => 'afterRegister', 'Controller.Users.afterForgotPassword' => 'afterForgotPassword'];
return array_merge($_events, $events);
}
示例2: implementedEvents
/**
* Implemented events
*
* @return array
*/
public function implementedEvents()
{
$_events = parent::implementedEvents();
$events = [];
if ($this->config('lastSeen')) {
$events['Component.Manager.beforeFilter'] = 'lastSeenEvent';
}
if ($this->config('passwordRequests')) {
$events['Controller.Users.afterForgotPassword'] = 'passwordRequestEvent';
}
if ($this->config('lastLogin') || $this->config('passedLogins')) {
$events['Controller.Users.afterLogin'] = 'afterLoginEvent';
}
if ($this->config('failedLogins')) {
$events['Controller.Users.afterInvalidLogin'] = 'invalidLoginEvent';
}
return array_merge($_events, $events);
}