Jump to content


callback_insert not working

callback insert bootstrap

  • Please log in to reply
1 reply to this topic

#1 Allan Alvarez Ortiz

Allan Alvarez Ortiz

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 27 July 2015 - 11:32 PM

Hi i'm having a problem with grocery crud, i want to use the callback_insert to create some rules on the insert but its not working not even by doing nothing i mean setting the callback_insert like this:
 

$crud->callback_insert(array($this,'insert'));

and the funtion like this:

function insert($post_array) {
      return $this->db->insert('archivo',$post_array);
}

it keep giving me in google chrome console:
 

POST http://localhost/agenda/index.php/backend/archivo/insert 500 (Internal Server Error)


#2 Paul Savostin

Paul Savostin

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationUkraine

Posted 28 July 2015 - 12:39 PM

Hi! In order to add some rules like validation you can use ->set_rules with custom callback function
 

For help it better write here

1) all code function and callback function code

2) Maybe database shema of table


3) Maybe write what logic u want implement before insert

 

 

Then I could help you!







Also tagged with one or more of these keywords: callback, insert, bootstrap

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users