Jump to content

How does the callaback functions work?


  • Please log in to reply
2 replies to this topic

#1 Carlos Bernal

Carlos Bernal


  • Members
  • Pip
  • 3 posts

Posted 27 October 2013 - 08:25 PM



I need to do some customization to the CRUD. Basically i need to upload multiple files in an Add or Edit Action, and all i'm going to save in the database is the url of the folder that will contain the images.


I have been searching the forum, and it seems like I have to do this myself.


What i'm doing, is showing multiple upload buttons using the add_field_callbak, and so far so good.


The problem is that i also need some custom callback, to save the name and url of the uploaded files.


I've been reading the GroceryCRUD source code, and cant figure out how to use or create callbacks. I'm trying to use "call_user_func" for the callbacks, however, it doesn't work because each upload creates a new PHP request, and the variable that saves the user callback is empty in this context.


I was wondering if someone could explain me how do the GroceryCRUD callbacks work.


Thank you for your time.

#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 28 October 2013 - 09:22 AM

Hello Carlos Bernal


Welcome to the GC Forum


Well there are many solutions ppl have been providing .. custom js / some work out with integrating (GC with IC [ImageCrud]) - that all works out but the best i loved to go with  was this




This truly have worked for me and so will for you.


Happy GCing

#3 Carlos Bernal

Carlos Bernal


  • Members
  • Pip
  • 3 posts

Posted 28 October 2013 - 04:11 PM

Indeed that post was very useful, thank you very much Amit

Also tagged with one or more of these keywords: callback

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users