PHP Класс yii\filters\auth\AuthMethod

С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends yii\base\ActionFilter, implements yii\filters\auth\AuthInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$optional list of action IDs that this filter will be applied to, but auth failure will not lead to error. It may be used for actions, that are allowed for public, but return some additional data for authenticated users. Defaults to empty, meaning authentication is not optional for any action. Since version 2.0.10 action IDs can be specified as wildcards, e.g. site/*.
$request the current request. If not set, the request application component will be used.
$response the response to be sent. If not set, the response application component will be used.
$user the user object representing the user authentication status. If not set, the user application component will be used.

Открытые методы

Метод Описание
beforeAction ( $action )
challenge ( $response )
handleFailure ( $response )

Защищенные методы

Метод Описание
isOptional ( Action $action ) : boolean Checks, whether authentication is optional for the given action.

Описание методов

beforeAction() публичный Метод

public beforeAction ( $action )

challenge() публичный Метод

public challenge ( $response )

handleFailure() публичный Метод

public handleFailure ( $response )

isOptional() защищенный Метод

Checks, whether authentication is optional for the given action.
См. также: optional
С версии: 2.0.7
protected isOptional ( Action $action ) : boolean
$action yii\base\Action action to be checked.
Результат boolean whether authentication is optional or not.

Описание свойств

$optional публичное свойство

list of action IDs that this filter will be applied to, but auth failure will not lead to error. It may be used for actions, that are allowed for public, but return some additional data for authenticated users. Defaults to empty, meaning authentication is not optional for any action. Since version 2.0.10 action IDs can be specified as wildcards, e.g. site/*.
См. также: isOptional()
С версии: 2.0.7
public $optional

$request публичное свойство

the current request. If not set, the request application component will be used.
public $request

$response публичное свойство

the response to be sent. If not set, the response application component will be used.
public $response

$user публичное свойство

the user object representing the user authentication status. If not set, the user application component will be used.
public $user