本文整理汇总了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;
}