2012-03-21 54 views
0

我一直在閱讀這篇文章Creating a login form in CodeIgniter based on Ion Auth library,但我仍然有一個關於如何在ion auth中調用方法的問題。Ion auth,調用方法?

的文檔狀態:

NOTE: Methods available in the model are called through the controller using PHP5 magic. You should never use ion_auth_model->method() in your applications. 

但隨後的例子顯示:

$this->ion_auth->login($identity, $password, $remember); 

如果我已經自動裝載了Ion_auth庫在我autoload.php,到底我該如何調用的方法?

回答

1

您應該知道庫和模型之間存在差異。該文檔指出,您不應該從模型中調用方法。相反,加載庫並調用其中的方法。也許你誤解了這條線?

+0

嗯,我只是從文檔中複製並粘貼了這兩行。 – redconservatory 2012-03-21 13:39:02

+0

哦,等等,我明白你的意思,所以我不應該做ion_auth_model-> login(),但是$ this-> ion_auth-> login()可以嗎?咄。 – redconservatory 2012-03-21 13:44:42