Can I use $crud->callback_before_insert() and $crud->callback_after_upload() in the same CRUD function in the controller? How about two calls such as
$crud->callback_before_insert(a)
$crud->callback_before_insert(g)
??
⚠ 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. ⚠
Posted 23 July 2020 - 01:51 PM
Can I use $crud->callback_before_insert() and $crud->callback_after_upload() in the same CRUD function in the controller? How about two calls such as
$crud->callback_before_insert(a)
$crud->callback_before_insert(g)
??
Posted 23 July 2020 - 07:59 PM
The reason that I am asking is that I am having trouble with call backs and I am not sure what the problem is. I have callback
$crud->callback_after_insert(array($this, 'add_email'));
here is add email:
function add_email($post_array)
{
$post_array['email'] = $this->session->userdata('userid');
$post_array['campaign'] = $this->session->userdata('campaign');
return $post_array;
}
The problem is that unless the field email and the field campaign display in the add form, they don't appear in the post array. Thus if I have made them invisible in the add form like this:
$crud->change_field_type('email', 'invisible');
$crud->change_field_type('campaign', 'invisible');
They don't appear in the $post_array and I can't change them.
Support →
Bugs / Issues →
Cstome Error Message On set_rule callback does NOT appearStarted by fede72bari, 06 Mar 2021 ![]() |
|
![]() |
||
Support →
I have a question →
Getting setRelation field Value instead of ID in callback_before_insertStarted by AlokNikhil, 26 Dec 2020 ![]() |
|
![]() |
||
Support →
I have a question →
Change date format in relation_n_n Name StringStarted by Timti, 02 Dec 2019 ![]() |
|
![]() |
||
Support →
Grocery CRUD Enterprise →
Insert Account number on AddStarted by drinkingwine, 15 Oct 2019 ![]() |
|
![]()
|
||
Support →
I have a question →
Recover original value of column after column callbackStarted by ENSASKE, 04 Mar 2019 ![]() |
|
![]() |
0 members, 0 guests, 0 anonymous users