我加入权威性的功能create_user控制器():
if ($this->ion_auth->is_admin())
{
$this->data['groups'] = $this->ion_auth->groups()->result_array(); // выбираем все группы
$groups=$this->data['groups'];
}
...
if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data, $groups))
...
其次,鉴于我添加下拉字段,并希望从表“群体”的所有组来填充它:
<div class="grid_8"><p>Добавить в группы:<br />
<?php echo form_dropdown('groups',$groups) ?></p></div>
但我得到mistaked下拉列表:
0
1
admin
Administrator
1
2
moderator
Moderator
...
请帮助我了解如何使所有群体的好名单:
Administrator
Moderator
User
...