⚠ 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

callback_after_upload



marco
  • profile picture
  • Member

Posted 11 April 2018 - 12:36 PM

Hi,

 

I want to have the $primary_key in my function "traitement_pdf_after, but it seems I can only have $uploader_response, $field_info, $files_to_upload :(

$crud->callback_after_upload(array($this,'traitement_pdf_after'));
function traitement_pdf_after($uploader_response, $field_info, $files_to_upload)

There is a tip for have $primary key with callback_after_upload ?

 

Thanks !

Marco


marco
  • profile picture
  • Member

Posted 27 April 2018 - 08:55 AM

Hi

 

my solution :D

 

in __construct()

$this->load->library('session');

in function

$state = $crud->getState();
$state_info = $crud->getStateInfo();
if($state == 'edit')
{
     $this->session->set_userdata('id_en_cours', $state_info->primary_key);
}

in callback

$id_part  = $this->session->userdata('id_en_cours');

I hope this tip help someone ! ;)