请谁能帮我我想从文件夹codeigniter中删除文件这是我的控制器
public function delete($id = false) {
if (!$id)
show_404();
$this->{$this->model}->{$this->_primary_key} = $id;
$data['item'] = $this->{$this->model}->get();
if (!$data['item'])
show_404();
$this->{$this->model}->delete();
redirect('admin/' . $this->module);
}
public function image($var, $id) {
$config['upload_path'] = './cdn/sliders/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$this->load->library('upload', $config);
if ($this->upload->do_upload('image')) {
$data = $this->upload->data();
if ($data['file_name'])
$this->{$this->model}->image = $data['file_name'];
}
return true;
}
喵喔喔
慕尼黑的夜晚无繁华
慕斯709654