Skip to content

Instantly share code, notes, and snippets.

@bijayrungta
Last active September 24, 2015 17:37
Show Gist options
  • Save bijayrungta/784409 to your computer and use it in GitHub Desktop.
Save bijayrungta/784409 to your computer and use it in GitHub Desktop.
Validation Rules for the Model.
class MyModel {
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
return array(
array(
'element',
'type',
'type' => 'string'
),
array(
'content',
'type',
'type' => 'string'
),
array(
'suggestion',
'type',
'type' => 'string'
),
array(
'notes',
'type',
'type' => 'string'
),
array(
'id, seo_project_id, webpage_id, user_id',
'numerical',
'integerOnly' => true
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment