Why does my administrator edit and update successfully, but there is no Ajax prompt?
Jerry
Jerry 2018-02-01 14:03:45
0
2
1268

An error will be reported in TP5 debugging state

Undefined variable: data

public function editUser(Request $request)
{
//Get the data returned by the form
// $data = $request -> param();
$param = $request -> param();

//Remove the empty data in the form, that is, the data that has not been modified Content
      foreach ($param as $key => $value ){
          if (!empty($value)){
                                                                                                 #     }
          $condition = ['id'=>$data['id']] ; ;
                                                                                                                                                      ; ##        Session::set('user_info.role', $data['role']);
      }

                                                                        use   using   using     use using ’s ’ using using ’ s ’ through using ’s ’ through ‐ to ‐ ‐‐‐‐‐ and ​ to >
}
}

Jerry
Jerry

reply all(2)
宇瞳

if($request->param('name')=='admin')
{
Session::set('user_info.role',$data['role']);
}



Change it to this

lge

Define data at the front of the method and assign it to empty

  • reply No, I am at the very beginning of the method, $data = null
    Jerry author 2018-02-01 16:52:29
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template