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);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?