⚠ 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

How to Print Post Array In Callback before Insert or Update



jt3angga
  • profile picture
  • Member

Posted 31 July 2012 - 07:26 AM

Hello,

I Create a Extra Field in My App, And the Field doesn't exist from table in the database,
How I can Get the Value in function Callback before Insert or Update??

My code :

[php]
$crud->fields('roleName','prv_list');
$crud->callback_field('prv_list',array($this,'group_prv_list'));
$crud->callback_before_insert(array($this,'before_insert_update_group_prv_list'));
$crud->callback_before_update(array($this,'before_insert_update_group_prv_list'));

function before_insert_update_group_prv_list($post_array, $primary_key = null) {
if($primary_key !== null) {
//Hot to get value From $post_array to update to Database
}
else {
//Hot to get value From $post_array to Insert to Database
}
return $post_array;
}
[/php]

The prv_list Not In Table of Database, Just a Custom View
And Can we do print_r($post_array) ??

And The View Is

[attachment=241:View_crud.png]

Thanks, And Sorry My English is Very Poor :)

jt3angga
  • profile picture
  • Member

Posted 01 August 2012 - 03:15 AM

Hello???

Abid Rizvi
  • profile picture
  • Member

Posted 03 July 2015 - 06:48 AM

same problem here


Paul Savostin
  • profile picture
  • Member

Posted 03 July 2015 - 09:17 AM

HI! So what the problem? If you do all right then in $post_array look key your input field by it name

O lol, so old post:D