Created
January 5, 2013 20:41
-
-
Save grassroot/4463546 to your computer and use it in GitHub Desktop.
Validation rules requested in http://stackoverflow.com/questions/14174329/yii-submit-a-value-to-different-model.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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( | |
array('name, value', 'safe'), | |
// The following rule is used by search(). | |
// Please remove those attributes that should not be searched. | |
array('id, name, value', 'safe', 'on'=>'search'), | |
array('name, value', 'required'), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment