1
尝试将图像url保存到数据库时删除样式属性我正在使用Summernote编辑器将文本和图像保存到db.Currently我在Codeigniter中嵌入了summernote,因此我将图像文件上传到服务器,网址并将图片插入编辑器。现在根据文档,我们可以调整上传到服务器的图像大小,并可以将CSS应用于图像。使用summernote编辑器
代码插入和应用Css显示完美的结果。笔记数据文件名属性正在保存。
$('#summernote').summernote('insertImage', objFile, function ($image) {
$image.css('width', $image.width()/3);
$image.attr('data-filename', 'retriever');
});
一切都很好,除了当我提交表单样式属性获取从img标记中删除和其余的数据得到保存。
我的控制器功能我在哪里保存数据到数据库。
if($this->input->post())
{
var_dump($_POST);
$this->data=array(
'PageID'=>$this->input->post('PageID'),
'Title'=>$this->input->post('Title'),
'Description'=>$this->input->post('Description'),
'Text'=>$this->input->post('Text'),
'CreatedBy' => 1,
'CreatedDate' => date('Y-m-d'),
'UpdatedBy' => 1,
'IsActive' => 1,
'IsDeleted' => 0
);
$Where=array('PageID'=>$this->input->post('PageID'));
$Result=$this->model->insert('pagedata',$this->data,'ID',$this->input->post('PageID'),$Where);
if($Result)
{
$this->session->set_flashdata('Success',"Page Updated Successfully");
$Path=previousURL();
redirect($Path);
}
else
{
$this->session->set_flashdata('Error',"Sorry Couldnt Update The Page");
$Path=previousURL();
redirect($Path);
}
}
注中的var_dump我看到的样式属性应用到IMG,但是当数据到达DB样式属性心不是有我的问题是style
标签不以dB为单位节约了,而其应用到图像时,我上传他们我的意思是说它存在
让我检查它是否有效 –