Wednesday, December 18, 2013

Yii beforeSave method

 function beforeSave() {
            
        if (parent::beforeSave()) {
            if($this->isNewRecord) {
            $this->password=md5($this->password);
             $this->createdate=date("Y-m-d, g:i a");
            }
        else {
            $this->modifydate=date("Y-m-d, g:i a");
          }
        
        }
        return true;
    }

No comments:

Post a Comment