Using CodeIgniter Tank-Auth as a package?

耗尽温柔 提交于 2019-12-12 00:58:15

问题


Is it possible to get Tank-Auth working as a package in CodeIgniter?

I installed database schema into my MySQL database and copied all the folders of tank_auth in my app "third_party" folder "[CI]\application\third_party\tank_auth". The Screenshot :

Session works fine.

I can load tank_auth models

$this->load->model('tank_auth/users');

I can load tank_auth views

$this->load->view('auth/login_form');

But i can't access "auth" and "welcome" controllers. My application shows a 404. My log files has no warning or error other that the 404.

Any idea?

Simon


回答1:


From what I see you are trying to set up a Hierarchical Model-View-Controller (HMVC) within the codeigntier MVC. I do not think this is supported by core codeigniter by itself instead you might need to install Modular extension management. Checkout Modular Extensions (HMVC) for Codeigniter. This allows you to create modules as 'pseudo-controllers' which can access core CI framework classes.

Checkout more at http://getsparks.org/set-up-mx and of course google :)




回答2:


I found out in CI doc why it doesn't work and how to fix it properly : Here (section Application "Packages")

You can put there ressources only, not controllers. I then moved the controllers (auth and welcome) to my CI application/controllers folder. Everything works now.



来源:https://stackoverflow.com/questions/11873275/using-codeigniter-tank-auth-as-a-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!