How to change $model->attributes value in controller - Yii

后端 未结 2 943
谎友^
谎友^ 2021-01-13 23:32

UserMasterController Code:

public function actionUpdate($id){

    $model=$this->loadModel($id);

    if(isset($_POST[\'UserMaster\'])){
        $model-&g         


        
相关标签:
2条回答
  • 2021-01-13 23:39

    Use $model->emailsent='N';. Thats all

    0 讨论(0)
  • 2021-01-13 23:57

    Just try this $model->setAttribute($name,$value);

    0 讨论(0)
提交回复
热议问题