⚠ 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

Multiple pages by using Grocery CRUD



Chan Chea
  • profile picture
  • Member

Posted 01 November 2018 - 10:02 AM

Dear all,

 

How to include multiple pages by using grocery crud with CodeIgniter?

Here my code: 

 

public function _example_output($output = null)
{
$this->load->view('example',(array)$output);
}
 
public function users_management()
{
$crud = new grocery_CRUD();
 
// $crud->set_theme('datatables');
$crud->set_table('users');
$crud->columns('username','email','gender','photo','g_id');
$crud->set_relation('g_id','user_groups','description');
$crud->display_as('g_id', 'User group');
$crud->set_subject('Employee');
$crud->field_type('password', 'password');
$crud->set_field_upload('photo','assets/uploads/files');
$crud->callback_add_field('gender',array($this,'add_field_callback_1'));
$crud->callback_edit_field('gender',array($this,'add_field_callback_1'));
$output = $crud->render();
 
$this->_example_output($output);
}
function add_field_callback_1()
{
return ' <input type="radio" name="gender" value="Male" /> Male
<input type="radio" name="gender" value="Female" /> Female';