本文整理匯總了PHP中yii\filters\AccessControl::isActive方法的典型用法代碼示例。如果您正苦於以下問題:PHP AccessControl::isActive方法的具體用法?PHP AccessControl::isActive怎麽用?PHP AccessControl::isActive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類yii\filters\AccessControl
的用法示例。
在下文中一共展示了AccessControl::isActive方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isActive
/**
* Returns a value indicating whether the filer is active for the given action.
* @param \yii\base\Action $action the action being filtered
* @return boolean whether the filer is active for the given action.
*/
protected function isActive($action)
{
if ($action->getUniqueId() === Yii::$app->getErrorHandler()->errorAction) {
return false;
}
return parent::isActive($action);
}
示例2: isActive
/**
* @inheritdoc
*/
protected function isActive($action)
{
if ($this->isErrorPage($action) || $this->isLoginPage($action) || $this->isAllowedAction($action)) {
return false;
}
return parent::isActive($action);
}
示例3: isActive
/**
* Returns a value indicating whether the filter is active for the given action.
* @param InlineAction $action the action being filtered
* @return boolean whether the filer is active for the given action.
*/
protected function isActive($action)
{
$uniqueId = $action->getUniqueId();
if ($uniqueId === Yii::$app->getErrorHandler()->errorAction) {
return false;
} else {
if (Yii::$app->user->isGuest && Yii::$app->user->loginUrl == $uniqueId) {
return false;
}
}
return parent::isActive($action);
}