我的表结构如下所示:
=============================== 身份证 | 姓名 | 图片| ===============================
现在我想要多个带有名称的图像。我该怎么做。
if($this->request->is('post'))
{
if($this->Breakdown->saveAll($this->request->data['Breakdown']))
{
//Image insertion Successfully
$image=$this->request->data['Breakdown'][0]['image1']['name'];
if(!empty($this->request->data['Breakdown'][0]['image1']['name']))
{
$image_path = $this->Image->upload_image_and_thumbnail($image,$this->data['Breakdown'][0]['image1'],600,450,180,120, "Breakdown");
//echo "This".$image_path;
if(isset($image_path))
{
$this->Breakdown->saveField('image',$image_path);
$uploaded = true;
}
}
$this->Session->setFlash('Quantity Breakdown has been added Successfully.', 'default', array('class' => 'oMsg1 oMsgError1'));
$this->redirect('qty_breakdown');
}
else
{
$this->set('errors', $this->Breakdown->invalidFields());
}
有没有其他方法可以使用循环插入和上传多个图像?