PHP Класс amnah\yii2\user\Module

Автор: amnah ([email protected])
Наследование: extends yii\base\Module, implements yii\base\BootstrapInterface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$alias Alias for module
$emailChangeConfirmation If true, users will have to confirm their email address after changing it on the account page
$emailConfirmation If true, users will have to confirm their email address after registering (= email activation)
$emailViewPath Email view path
$loginDuration Login duration
$loginEmail If true, users can log in using their email
$loginExpireTime Login via email token expiration (passed to strtotime())
$loginRedirect Url to redirect to after logging in. If null, will redirect to home page. Note that AccessControl takes precedence over this (see [[yii\web\User::loginRequired()]])
$loginUsername If true, users can log in using their username
$logoutRedirect Url to redirect to after logging out. If null, will redirect to home page
$modelClasses Model classes, e.g., ["User" => "amnah\yii2\user\models\User"] Usage: $user = Yii::$app->getModule("user")->model("User", $config); (equivalent to) $user = new \amnah\yii2\user\models\User($config); The model classes here will be merged with/override the [[getDefaultModelClasses()|default ones]]
$requireEmail If true, users are required to enter an email
$requireUsername If true, users are required to enter a username
$resetExpireTime Reset password token expiration (passed to strtotime())
$useEmail If true, users can enter an email. This is automatically set to true if $requireEmail = true
$useUsername If true, users can enter a username. This is automatically set to true if $requireUsername = true

Защищенные свойства (Protected)

Свойство Тип Описание
$version Module version

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

Метод Описание
createController ( $route ) Modify createController() to handle routes in the default controller
getActions ( ) Get a list of actions for this module. Used for debugging/initial installations
getVersion ( ) : string Get module version
init ( )
model ( string $name, array $config = [] ) : ActiveRecord Get object instance of model

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

Метод Описание
checkModuleProperties ( ) Check for valid email/username properties
getDefaultModelClasses ( ) Get default model classes

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

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

Check for valid email/username properties
protected checkModuleProperties ( )

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

This is needed because of the way we map actions to "user/default/". We can't use module bootstrapping because that doesn't work when urlManager.enablePrettyUrl = false. Additionally, this requires one less step during installation
public createController ( $route )

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

Get a list of actions for this module. Used for debugging/initial installations
public getActions ( )

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

Get default model classes
protected getDefaultModelClasses ( )

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

Get module version
public getVersion ( ) : string
Результат string

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

public init ( )

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

Get object instance of model
public model ( string $name, array $config = [] ) : ActiveRecord
$name string
$config array
Результат yii\db\ActiveRecord

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

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

Alias for module
public $alias

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

If true, users will have to confirm their email address after changing it on the account page
public $emailChangeConfirmation

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

If true, users will have to confirm their email address after registering (= email activation)
public $emailConfirmation

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

Email view path
public $emailViewPath

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

Login duration
public $loginDuration

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

If true, users can log in using their email
public $loginEmail

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

Login via email token expiration (passed to strtotime())
public $loginExpireTime

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

Url to redirect to after logging in. If null, will redirect to home page. Note that AccessControl takes precedence over this (see [[yii\web\User::loginRequired()]])
public $loginRedirect

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

If true, users can log in using their username
public $loginUsername

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

Url to redirect to after logging out. If null, will redirect to home page
public $logoutRedirect

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

Model classes, e.g., ["User" => "amnah\yii2\user\models\User"] Usage: $user = Yii::$app->getModule("user")->model("User", $config); (equivalent to) $user = new \amnah\yii2\user\models\User($config); The model classes here will be merged with/override the [[getDefaultModelClasses()|default ones]]
public $modelClasses

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

If true, users are required to enter an email
public $requireEmail

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

If true, users are required to enter a username
public $requireUsername

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

Reset password token expiration (passed to strtotime())
public $resetExpireTime

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

If true, users can enter an email. This is automatically set to true if $requireEmail = true
public $useEmail

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

If true, users can enter a username. This is automatically set to true if $requireUsername = true
public $useUsername

$version защищенное свойство

Module version
protected $version