本文整理匯總了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);
}