Hi web-johnny,
I’ve been working with GroceryCRUD a bit more.
How do we use the CodeIgniter form helper with GroceryCRUD? Is this possible?
Thanks,
Matthew
Thank you goFrendiAsgard for your answer and yes you are right.
The only way to actually use the form_helper is with the callback_add_field and callback_edit_field. But to tell you the truth I don’t understand why and where to use form_helper for grocery CRUD. An example of using a form helper could be:
function example_callback_add_field(){
$this->grocery_crud->set_table('offices');
$this->grocery_crud->set_subject('Office');
$this->grocery_crud->required_fields('city');
$this->grocery_crud->columns('city','country','phone','addressLine1','postalCode');
$this->grocery_crud->callback_add_field('phone',array($this,'add_field_callback_1'));
$output = $this->grocery_crud->render();
$this->_example_output($output);
}
function add_field_callback_1()
{
$this->load->helper('form');
return '+30 '.form_input('phone', '');
}
But I don’t really understand what are you looking for.