This is my code,now i can only able to insert single value but i want more than one value to be inserted
public function cms_category_selected() {
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('articles');
$crud->set_subject('Article');
$crud->display_as('article_id', 'Article ID')
->display_as('article_name', 'Article Name')
->display_as('article', 'Article')
->display_as('category_id', 'Category ID')
->display_as('article_image', 'Article Image')
->display_as('tags', 'Tags')
->display_as('created_date', 'Created Date');
$crud->set_relation('category_id', 'cms_category', 'category_name');
$crud->set_relation('type_id', 'cms_types', 'type_name');
$crud->callback_edit_field('category_id', array($this, 'edit_category_field'));
$crud->callback_add_field('category_id', array($this, 'edit_category_field'));
$crud->callback_edit_field('tags', array($this, 'edit_tags_field'));
$crud->callback_add_field('tags', array($this, 'edit_tags_field'));
$crud->columns('article_id', 'article_name', 'category_id', 'type_id', 'created_date', 'tags','article_image');
$crud->required_fields('article_name', 'article', 'category_id', 'type_id');
$crud->set_field_upload('article_image', 'assets/uploads/articleImages');
// $crud->callback_after_upload(array($this,'example_callback_after_upload'));
$crud->fields('article_name', 'article', 'type_id', 'tags','article_image');
$output = $crud->render();
$this->_example_output($output);
}
public function wellness_cms_category_selected()
{
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('articles');
$crud->set_subject('Article');
$crud->display_as('article_id', 'Article ID')
->display_as('article_name', 'Article Name')
->display_as('article', 'Article')
->display_as('category_id', 'Category ID')
->display_as('article_image', 'Article Image')
->display_as('tags', 'Tags')
->display_as('created_date', 'Created Date');
$crud->set_relation('category_id', 'cms_category', 'category_name');
$crud->set_relation('type_id', 'cms_types', 'type_name');
$crud->callback_edit_field('category_id', array($this, 'edit_category_field'));
$crud->callback_add_field('category_id', array($this, 'edit_category_field'));
$crud->callback_edit_field('tags', array($this, 'edit_tags_field'));
$crud->callback_add_field('tags', array($this, 'edit_tags_field'));
$crud->columns('article_id', 'article_name', 'category_id', 'type_id', 'created_date', 'tags','article_image');
$crud->required_fields('article_name', 'article', 'category_id', 'type_id');
$crud->set_field_upload('article_image', 'assets/uploads/articleImages');
// $crud->callback_after_upload(array($this,'example_callback_after_upload'));
$crud->fields('article_name', 'article', 'type_id', 'tags','article_image');
$output = $crud->render();
$this->_example_output($output);
}
function edit_tags_field() {
return ' <input type="checkbox" name="tags" value="male" /> Male
<input type="checkbox" name="tags" value="female" /> Female';
}