當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。