dongyan2445 2010-12-31 13:07
浏览 51
已采纳

尝试为CI安装Auth:调用未定义的方法CI_Loader :: setdata()

I have been trying to implement an auth system for Codeigniter. I wanted to save time, though it hasn't succeeded so far.

The system I'm trying to implement is: http://codeigniter.com/wiki/auth/

Currently I have some forms working, but the registration form generates a fatal error: PHP Fatal error: Call to undefined method CI_Loader::setdata() in /Applications/MAMP/htdocs/CI+Login/system/application/controllers/auth.php on line 159

Anyone has an idea what that is about? Anyone has got this system running?

thx.

EDIT: The code that generates the error is:

if ($this->config->item('auth_use_security_code'))
    $this->authlib->register_init();
            $data['countries'] = $this->Usermodel->getCountries();
$this->load->setdata($data);

The problem is that load does not contain a method named setdata, has it in a previous version of CI or what can I make of this?

  • 写回答

1条回答 默认 最新

  • driuwt9557 2010-12-31 13:31
    关注

    Try this:

    $this->load->vars($data);
    

    or remove this line and use the second parameter of the $this->load->view() function.

    $this->load->view($this->config->item('auth_register_view'),$data);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败