Skip to content

Instantly share code, notes, and snippets.

@grassroot
Created January 5, 2013 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grassroot/4463546 to your computer and use it in GitHub Desktop.
Save grassroot/4463546 to your computer and use it in GitHub Desktop.
/**
* @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