⚠ In case you've missed it we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠

Grocery Crud with Image Crud

file upload ImageCrud

  • Please log in to reply
1 reply to this topic

#1 Basheer Ahmed

Basheer Ahmed


  • Members
  • Pip
  • 1 posts

Posted 10 June 2015 - 01:14 PM

Hi every1


I've grocery crud on my system and I want to use Image crud with groceryCrud for multiple file upload.

I've two tables attraction and attraction_images.


attractions ------> id , title, description

attraction_images -----> attraction_id,attraction_image


public function attraction()
$crud = new grocery_CRUD();
$crud->field_type('description', 'text');
$crud->callback_column('image', array($this, 'callback_images'));
$output = $crud->render();
}catch(Exception $e){
       show_error($e->getMessage().' --- '.$e->getTraceAsString());


public function callback_images($value, $row)
$html = '<div>';
$positions = $this->db->get_where('attraction_images',array('attraction_id' => $row->id))->result_array();
     foreach ($positions as $items)
      $html.='<img src="'.base_url().'assets/uploads/files/'.$items['image'].'" style="width:200px;height:100px;"/>';
return $html;


Now when user want to add an attraction I want imageCrud uploadImage button Option so that he could add multiple image for single attraction and insert those images path to attraction_images table.

I'm newbie to ImageCrud If any buddy could please help me out. 



#2 Paul Savostin

Paul Savostin

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts

Posted 11 June 2015 - 08:47 AM

So what problem you have?

Also tagged with one or more of these keywords: file, upload, ImageCrud

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users