当前位置: 首页>>代码示例>>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;未经允许,请勿转载。