Preview: ExambodyForm.php
Size: 1.46 KB
/home/jambtst2015/public_html/protected/models/ExambodyForm.php
<?php
/**
* ContactForm class.
* ContactForm is the data structure for keeping
* contact form data. It is used by the 'contact' action of 'SiteController'.
*/
class ExambodyForm extends CFormModel
{
public $name;
public $full_name;
public $image;
public $body;
public $verifyCode;
public $validity;
public $no_of_subject;
/**
* Declares the validation rules.
*/
public function rules()
{
return array(
// name, email, subject and body are required
array('image','safe'),
array('image', 'file','types'=>'jpg', 'allowEmpty'=>true, 'on'=>'update' , 'on'=>'insert'),
array('name, full_name,no_of_subject', 'required'),
//array('validity', 'numerical', 'integerOnly'=>true),
array('validity', 'match' ,
'pattern'=> '/^[0-9]+$/u',
'message'=> 'Validity can contain only [0-9].'
),
array('no_of_subject', 'match' ,
'pattern'=> '/^[0-9]+$/u',
'message'=> 'Validity can contain only [0-9].'
),
// email has to be a valid email address
//array('email', 'email'),
// verifyCode needs to be entered correctly
//array('verifyCode', 'captcha', 'allowEmpty'=>!CCaptcha::checkRequirements()),
);
}
/**
* Declares customized attribute labels.
* If not declared here, an attribute would have a label that is
* the same as its name with the first letter in upper case.
*/
public function attributeLabels()
{
return array(
'verifyCode'=>'Verification Code',
);
}
}
Directory Contents
Dirs: 0 × Files: 45