【问题标题】:ion auth and codeigniterion auth 和 codeigniter
【发布时间】:2013-02-11 18:46:18
【问题描述】:

我是第一次使用 codeigniter 和 ion auth。我已经完成了所有工作,但是在 ion auth 模板中,索引视图显示了所有用户的列表。

<?php foreach ($users as $user):?>
    <tr>
        <td><?php echo $user->first_name;?></td>
        <td><?php echo $user->last_name;?></td>
        <td><?php echo $user->email;?></td>
        <td>
            <?php foreach ($user->groups as $group):?>
                <?php echo anchor("auth/edit_group/".$group->id, $group->name) ;?><br />
            <?php endforeach?>
        </td>
        <td><?php echo ($user->active) ? anchor("auth/deactivate/".$user->id, 'Active') : anchor("auth/activate/". $user->id, 'Inactive');?></td>
        <td><?php echo anchor("auth/edit_user/".$user->id, 'Edit') ;?></td>
    </tr>
<?php endforeach;?>

通常 $users 数组来自模型。但是在查看模型(ion_auth_model)时,我看不到任何特定于 $users 的内容。身份验证控制器也没有给我太多。

documentation 中,users() 函数是: $users = $this->ion_auth->users();

我认为这是在索引页上填充的数组。如果不在模型中,这将如何提取 MySQL 数据?这是如何运作的?

【问题讨论】:

    标签: codeigniter ion-auth


    【解决方案1】:

    @Smudger - 仔细看一下,ion_auth_model 有一个函数 users() 从第 1125 行开始(取决于你的版本),它接受一个可选的 $groups 参数

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-07
    • 1970-01-01
    • 1970-01-01
    • 2012-06-23
    • 2011-10-12
    • 2013-06-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多