use ion auth authentication for codeigniter in another controller

后端 未结 3 1876
长发绾君心
长发绾君心 2021-01-22 09:03

I am trying to build a web application with codeigniter. I have installed Ion Auth as my authentication model.

The default Auth.php controller authenticates the user and

3条回答
  •  孤城傲影
    2021-01-22 09:27

    jcorrys approach should work. An alternative approach (which will give your entire application a great deal more flexibility is to use a modular layout - https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc

    You will have to do a bit of fiddling to get it to play nicely with ion auth, but following the instructions in this question worked for me: Using Ion Auth as a separate module in the HMVC structure (have a look at the forks of ion auth on git hub - I think someone may have already done it for you)

    This approach will allow you to access any method in any controller from anywhere in your application (even from a view if you need to) using this kind of syntax: modules::run('module/controller/method', $params);

    This will essentially allow you to develop the existing ion auth controller into a user management controller which you can access from any other controllers you create (nice and dry).

提交回复
热议问题