1

我有一个用户管理脚本,我计划移植到 codeigniter。

Login extends Integration

              Integration extends Generic

                                  Generic extends Connect

Login继承Integration,并Integration继承Generic.etc。所以我可以访问Genericvia中的功能Login。是否有必要制作Login extends CI_Model,如果需要,如何集成其他类,以便在通过调用登录时保持相同的功能$this->load->models()

4

1 回答 1

1

CI_Model 允许您直接使用 DB 对象而无需自己导入它——这是它唯一做的事情。如果您的登录库不需要这些功能,或者您不打算将其移植为“CI 库”,您可以简单地将其作为普通库加载:

$this->load->library(); 
于 2013-08-21T21:45:42.647 回答