⚠ 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

call back functions in a helper file



fieldju
  • profile picture
  • Member

Posted 31 May 2012 - 01:34 AM

Is it possible to store call back functions in a helper file or is it required that they be in a controller?

kenvogt
  • profile picture
  • Member

Posted 31 May 2012 - 18:58 PM

What matters is that your callback functions can be reached with $this->your_function_name() from your controller.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 31 May 2012 - 20:22 PM

Yeap you can easily call them like this:


$crud->callback_edit_field('phone','edit_field_callback_1');


where edit_field_callback_1 is a function from your helper. For more about callbacks you can read http://php.net/manual/en/function.call-user-func.php