Skip to main content

Posts

Showing posts with the label validation

yii, some form validation examples

Yii some basic form validations using rules in models like email, compare password (match password), date, unique, captcha etc Below is full model code: <?php /** * This is the model class for table "users". * * The followings are the available columns in table 'users': * @property integer $user_id * @property string $user_name * @property string $user_password * @property string $user_email * @property string $user_gender * @property integer $user_age * @property string $user_location * @property string $user_avatar * @property string $user_facebook_id * @property integer $user_receive_newsletters_flag * @property integer $is_admin */ class Users extends CActiveRecord { public $confirm_password , $user_captcha ; /** * Returns the static model of the specified AR class. * @return Users the static model class */ public static function model ( $className = __CLASS__) { return parent :: model (...