Welcome Guest, Not a member yet? Register   Sign In
IONAuth Blank Groups when register
#1

[eluser]Unknown[/eluser]
Hi everyone..

I have some problem with ion_auth library, and I follow the documentation, i have some clue from there and the net too, the sample code:
Code:
$group = array('');
    $groups = $this->ion_auth->groups()->result();
    foreach ($groups as $gr)
    {
     $group[$gr->id] = $gr->name;
    }
    // ----------------
    
    $data['group'] = $group;
                                dump('group'); exit;
that's code to populate groups in table, and some code from others:
Code:
/*
  * http://stackoverflow.com/questions/11098339/add-user-to-groups-when-creating-user-in-ion-auth-using-form-dropdown
  *  
  */
public function grouplist()
{
  $query = $this->db->get('groups');

  foreach ($query->result() as $row)
  {
   $listArray[$row->id] = $row->name;
  }

  return $listArray;
}
// populate group
    // $data['listGroups'] = $this->grouplist();
    <?= form_dropdown('groups', $listGroups, '1'); ?>

but, with 2 way i try, it's always give me 'blank groups' in table user_group.. and some error code information in line:
Code:
in line 833 on ion_auth_model.php


i hope everyone give me shot, to the point, how to 'right' code for register new user, when i passing data from post form , i really appreciate you time.

thx.




Theme © iAndrew 2016 - Forum software by © MyBB