⚠ 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 is an archived forum. ⚠

  •     

profile picture

Call external php script and add_action link to external pdf



wonder

wonder
  • profile picture
  • Member

Posted 03 February 2013 - 10:16 AM

Hi there,

Loving this script but not getting anywhere with the last part....

I use the script http://www.fpdf.org/ to generate pdf's from the same mysql data which is being manipulated by grocery CRUD.

1) I want to run the 'create_pdf.php' file everytime there is a change generated by the controller so that the pdf file is current.
How do I run the pdf file each time the controller is used? I would prefer not to use cron. The fpdf class is kept outside of the Code Igniter installation.

2) Using add_action how do I add a link to the generated pdf's in grocery CRUD? The problem is that the pdf's are generated outside of the Code Igniter installation and add_action doesn't seem to let me make the correct link.

Many thanks for any hints,

Piers

davidoster

davidoster
  • profile picture
  • Member

Posted 05 February 2013 - 08:41 AM

1) I would suggest to bring inside CI/GroceryCrud the fpdf class. This way you will be  able to use it straight away from the GrroceryCrud. Since you have done this you can use the callback_after_insert/update functions to run the code for the fpdf! Check the manual of GC for the callback_after_insert/update

 

2) By the time you have done 1) you won't have any problems with it!!!