本文整理匯總了PHP中dektrium\user\models\User::rules方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::rules方法的具體用法?PHP User::rules怎麽用?PHP User::rules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dektrium\user\models\User
的用法示例。
在下文中一共展示了User::rules方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: rules
public function rules()
{
$rules = parent::rules();
// add some rules
$rules['vmlistLength'] = ['vmlist', 'string', 'max' => 255];
return $rules;
}
示例2: rules
public function rules()
{
$rules = parent::rules();
// Update the 'usernameLength' rule
$rules['usernameLength'] = ['username', 'string', 'min' => 3, 'max' => 255];
return $rules;
}
示例3: rules
public function rules()
{
$rules = parent::rules();
$rules['direccionRequired'] = ['direccion', 'required', 'on' => ['register', 'create', 'connect', 'update']];
$rules['direccionLength'] = ['direccion', 'string', 'max' => 255];
$rules['esActivoRequired'] = ['esActivo', 'required'];
return $rules;
}
示例4: rules
/** @inheritdoc */
public function rules()
{
$rules = parent::rules();
$rules = static::addSharedRules($rules);
// Set the admin rule.
$rules['is_adminInteger'] = ['is_admin', 'integer', 'min' => 0, 'max' => 1];
return $rules;
}
示例5: rules
public function rules()
{
$rules = parent::rules();
// add some rules
$rules['fieldRequired'] = ['role', 'required'];
$rules['fieldLength'] = ['role', 'string', 'max' => 10];
return $rules;
}
示例6: rules
public function rules()
{
$rules = parent::rules();
// add some rules
$rules['firstNameRequired'] = ['first_name', 'required'];
$rules['firstNameLength'] = ['first_name', 'string', 'max' => 255];
$rules['lastNameRequired'] = ['last_name', 'required'];
$rules['lastNameLength'] = ['last_name', 'string', 'max' => 255];
$rules['countryRequired'] = ['country', 'required'];
$rules['countryLength'] = ['country', 'string', 'max' => 2];
return $rules;
}
示例7: rules
public function rules()
{
$rules = parent::rules();
// add some rules
$rules['status_idInteger'] = ['status_id', 'integer'];
$rules['status_idDefault'] = ['status_id', 'default', 'value' => 1];
$rules['role_idIngeger'] = ['role_id', 'integer'];
$rules['role_idDefault'] = ['role_id', 'default', 'value' => 1];
// $rules['idcardString'] = ['idcard','string','length'=>13 ];
// $rules['idcardTrim'] =['idcard','filter','filter'=>'trim'];
// $rules['idcardPattern'] =['idcard','match','pattern' => $user::$idcardRegexp];
// $rules['idcardRequired'] = ['idcard', 'required'];
// $rules['idcardUnique'] = [
// 'phone',
// 'unique',
// 'targetClass' => $user,
// 'message' => Yii::t('user', 'This Phone Number has already been taken')
// ];
return $rules;
}
示例8: rules
public function rules()
{
$rules = parent::rules();
$rules[] = ['role', 'in', 'range' => [self::getAuthName('ROLE_MEMBER'), self::getAuthName('ROLE_SYSADMIN')]];
return $rules;
}
示例9: rules
/**
* {@inheritDoc}
*/
public function rules()
{
$rules = parent::rules();
$rules[] = [['role_id'], 'integer'];
return $rules;
}
示例10: rules
/** @inheritdoc */
public function rules()
{
return array_replace_recursive(parent::rules(), ['usernameRequired' => ['username', 'required', 'on' => []], 'usernameUnique' => ['username', 'safe']]);
}
示例11: rules
/**
* @inheritdoc
*/
public function rules()
{
$rules = parent::rules();
$rules['passwordLength']['min'] = self::PASSWORD_MIN_LENGTH;
return $rules;
}
示例12: rules
public function rules()
{
$rules = parent::rules();
//$rules[] = ['role', 'required'];
return $rules;
}