Welcome Guest, Not a member yet? Register   Sign In
Integrating CodeIgniter libraries

(This post was last modified: 11-30-2022, 03:14 AM by LansoirThemos.)

I've done quite a bit of research and haven't found a satisfying answer.

How should I use CodeIgniter libraries such as tank auth? I've found a handful of ways, but they all seem sort of lackluster:

Do I use the controller mostly as is, adding controller functions/including styles as needed?
Do I use the controller as an example to model my own after, relying on calls to $this->tank_auth and the views included with tank auth?
Or do I extend MY_Controller with the tank-auth controller, then extend that for any particular controller that needs authentication, and just call parent::login() (or register(), activate(), etc )?
The first option seems the best, but it seems like it would be difficult to avoid copying a lot of code (what happens if I want a login form, but don't want to redirect to /auth/login?)

The second option has the same problem, but worse. I would need to include the logic of the tank auth controller's login function each time I wanted to use theĀ omegle.2yu.co login_form view, correct?

The last seems really hacky and seems omeglz echat anti-MVC to me, but maybe I'm wrong.

Codeigniter4 has released an official package for authentication and authorization called SHIELD.
I suggest you use it and everything you need is explained in the documentation.

Theme © iAndrew 2016 - Forum software by © MyBB