Php 保存summernote';内容
我使用summernote作为我的所见即所得编辑器。因此,我使用formdata通过ajax提交了它的内容。我已经做了以下工作:Php 保存summernote';内容,php,css,codeigniter,summernote,Php,Css,Codeigniter,Summernote,我使用summernote作为我的所见即所得编辑器。因此,我使用formdata通过ajax提交了它的内容。我已经做了以下工作: formdata.append('content', $('.summernote').code()); 所以我的PHP接受了它并保存到我的数据库中。然而,所有css属性在保存时都消失了,如字体样式和字体大小等。我在php中使用CodeIgniter,这是我在保存中的代码: public function save_spot_report($data){
formdata.append('content', $('.summernote').code());
所以我的PHP接受了它并保存到我的数据库中。然而,所有css属性在保存时都消失了,如字体样式和字体大小等。我在php中使用CodeIgniter,这是我在保存中的代码:
public function save_spot_report($data){
$to_return = true;
$this->db->trans_begin();
$this->save_spot_report_details($data);
if($this->db->trans_status() === FALSE){
$this->db->trans_rollback();
$array['error_message'] = $this->db->_error_message();
$array['error_number'] = $this->db->_error_number();
$to_return = $array;
}else{
$this->db->trans_commit();
}
return $to_return;
}
public function save_spot_report_details($data){
$this->load->library('DateTimeHelper');
$data['created_by'] = $this->session->userdata('username');
$data['date'] = $this->datetimehelper->get_current_date();
$config['table'] = 'spot_report_tbl';
$config['data'] = $data;
$this->special_save($config);
}
public function special_save($config){
if(!isset($config['type'])){
$config['type'] = "INSERT";
}
if(strtolower($config['type']) === "insert"){
$this->db->insert($config['table'],$config['data']);
}else{
$this->db->where($config['conditions']);
if(!isset($config['use_set'])){
$this->db->update($config['table'], $config['data']);
}else{
$params = $config['set_params'];
$this->db->set($params['param_1'], $params['param_2'], $params['param_3']);
$this->db->update($config['table']);
}
}
return $this->check();
}
非常感谢您的回复!谢谢 如果您查看包含数据的表,它是否仍然包含所有样式都正确的HTML标记?它可能有伤口等逃脱,但那很好。如果在输出网页上“查看源代码”时,标记看起来如何?如果查看包含数据的表,它是否仍然包含所有样式都正确的HTML标记?它可能有伤口等逃脱,但那很好。如果在输出网页上“查看源代码”时,标记看起来如何?