當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CFormModel::rules方法代碼示例

本文整理匯總了PHP中CFormModel::rules方法的典型用法代碼示例。如果您正苦於以下問題:PHP CFormModel::rules方法的具體用法?PHP CFormModel::rules怎麽用?PHP CFormModel::rules使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CFormModel的用法示例。


在下文中一共展示了CFormModel::rules方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: rules

 /**
  * Validation rules
  *
  * @see CModel::rules()
  *
  * @return array
  */
 public function rules()
 {
     $rules = parent::rules();
     $rules[] = array('amount', 'in', 'range' => range(0, 10000));
     $rules[] = array('id_bank', 'safe');
     return $rules;
 }
開發者ID:LumbaJack,項目名稱:Mercado-BTX,代碼行數:14,代碼來源:CreateInvoiceForm.php

示例2: rules

 /**
  * Validation rules
  *
  * @see CModel::rules()
  *
  * @return array
  */
 public function rules()
 {
     $rules = parent::rules();
     $rules[] = array('email', 'email');
     $rules[] = array('email', 'unique');
     return $rules;
 }
開發者ID:LumbaJack,項目名稱:Mercado-BTX,代碼行數:14,代碼來源:AccountForm.php

示例3: rules

 /**
  * Declares the validation rules.
  * The rules state that username and password are required,
  * and password needs to be authenticated.
  */
 public function rules()
 {
     return array_merge(parent::rules(), array(array('username, password', 'required'), array('rememberMe', 'boolean'), array('password', 'authenticate')));
 }
開發者ID:VishalSuriMcc,項目名稱:jaspersiform,代碼行數:9,代碼來源:LoginForm.php

示例4: rules

 public function rules()
 {
     return array_merge(parent::rules(), array(array('userMembershipData', 'safe'), array('userNonMembershipData', 'safe')));
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:4,代碼來源:GroupUserMembershipForm.php

示例5: rules

 public function rules()
 {
     $rules = parent::rules();
     return array_merge($rules, array(array('password, password_check', 'length', 'max' => 128, 'min' => 6, 'message' => 'Incorrect password (minimal length 6 symbols).'), array('password_check', 'compare', 'compareAttribute' => 'password', 'message' => "Retype Password is incorrect.")));
 }
開發者ID:vasiliy-pdk,項目名稱:aes,代碼行數:5,代碼來源:ChangePasswordForm.php

示例6: rules

 /**
  * @return array validation rules for model attributes.
  */
 public function rules()
 {
     // NOTE: you should only define rules for those attributes that
     // will receive user inputs.
     return array_merge(parent::rules(), [['email, username', 'safe'], ['email, username', 'required'], ['email', 'length', 'max' => 255], ['password', 'length', 'min' => 6, 'max' => 128], ['username', 'length', 'min' => 3, 'max' => 20], ['username', 'match', 'pattern' => '/^[A-Za-z0-9_\\-\\.]+$/u', 'message' => 'Username can contain only alphanumeric characters, dot (.) and hyphens (-).']]);
 }
開發者ID:andryluthfi,項目名稱:annotation-tools,代碼行數:9,代碼來源:RegisterForm.php


注:本文中的CFormModel::rules方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。