Can you access a model from inside another model in CodeIgniter?

后端 未结 4 1522
感动是毒
感动是毒 2021-01-01 14:03

I am writing a webapp using CodeIgniter that requires authentication. I created a model which handles all my authentication. However, I can\'t find a way to access this auth

4条回答
  •  悲&欢浪女
    2021-01-01 14:52

    Don't handle authentication in your model. Only use models to interface with your database, or ldap or whatever.

    I created an Auth library that I use to manage authentication and authorization. You can access a library like this from your controllers.

提交回复
热议问题