Hello, how can I set the value of set_field_upload according the state of the CRUD operation?
$state = $crud->getState(); $state_info = $crud->getStateInfo(); if ( $state == 'edit' ) { $primary_key = $state_info->primary_key; $crud->set_field_upload('foto', 'assets/data/' . $primary_key); } elseif ( $state == 'add' ) { $crud->set_field_upload('foto', 'assets/uploads'); } // if
This is my code but, don't work, any suggestion? thanks