当前位置: 首页>>代码示例>>PHP>>正文


PHP User::rules方法代码示例

本文整理汇总了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;
 }
开发者ID:serveurexpress,项目名称:vmpanel,代码行数:7,代码来源:User.php

示例2: rules

 public function rules()
 {
     $rules = parent::rules();
     // Update the 'usernameLength' rule
     $rules['usernameLength'] = ['username', 'string', 'min' => 3, 'max' => 255];
     return $rules;
 }
开发者ID:infoweb-internet-solutions,项目名称:yii2-cms-user,代码行数:7,代码来源:User.php

示例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;
 }
开发者ID:apmauj,项目名称:1f8bf10ab74d6f5ca69f7c07b7ee1c38,代码行数:8,代码来源:User.php

示例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;
 }
开发者ID:singleso,项目名称:singleso,代码行数:9,代码来源:User.php

示例5: rules

 public function rules()
 {
     $rules = parent::rules();
     // add some rules
     $rules['fieldRequired'] = ['role', 'required'];
     $rules['fieldLength'] = ['role', 'string', 'max' => 10];
     return $rules;
 }
开发者ID:KhemPoudel,项目名称:onlinePaathsaala,代码行数:8,代码来源:User.php

示例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;
 }
开发者ID:statsandresults,项目名称:statsandresults,代码行数:12,代码来源:User.php

示例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;
 }
开发者ID:ajnok,项目名称:yii2-account,代码行数:20,代码来源:User.php

示例8: rules

 public function rules()
 {
     $rules = parent::rules();
     $rules[] = ['role', 'in', 'range' => [self::getAuthName('ROLE_MEMBER'), self::getAuthName('ROLE_SYSADMIN')]];
     return $rules;
 }
开发者ID:baobkath,项目名称:lenguage_center,代码行数:6,代码来源:BUser.php

示例9: rules

 /**
  * {@inheritDoc}
  */
 public function rules()
 {
     $rules = parent::rules();
     $rules[] = [['role_id'], 'integer'];
     return $rules;
 }
开发者ID:navatech,项目名称:yii2-user-role,代码行数:9,代码来源:User.php

示例10: rules

 /** @inheritdoc */
 public function rules()
 {
     return array_replace_recursive(parent::rules(), ['usernameRequired' => ['username', 'required', 'on' => []], 'usernameUnique' => ['username', 'safe']]);
 }
开发者ID:itnelo,项目名称:digitaldali-portal-template-php-yii2,代码行数:5,代码来源:User.php

示例11: rules

 /**
  * @inheritdoc
  */
 public function rules()
 {
     $rules = parent::rules();
     $rules['passwordLength']['min'] = self::PASSWORD_MIN_LENGTH;
     return $rules;
 }
开发者ID:noogen-projects,项目名称:yii2-app-start,代码行数:9,代码来源:User.php

示例12: rules

 public function rules()
 {
     $rules = parent::rules();
     //$rules[] = ['role', 'required'];
     return $rules;
 }
开发者ID:lenarx,项目名称:yii2-cms-app-full,代码行数:6,代码来源:User.php


注:本文中的dektrium\user\models\User::rules方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。