我无法正常使用hmvc和tank auth(设置为模块)设置正在运行的Codeigniter版本2.0.3。我已经安装了CI适当,然后安装HMVC与这些方向https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home使用tank验证码设置Codeigniter HMVC
我得到我的欢迎控制器/视图作为例子就好了,这意味着HMVC正在工作。接下来,我尝试将tank auth添加到项目中,方法是将其添加到modules文件夹中的文件夹中。它具有适当的控制器/视图/模型等。我甚至在路线中加入了类似
$ route [“auth”] =“auth/login”;
我也按照指示将auth模块内的控制器扩展到MX_Controller。另外,在构造函数中我有:
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->load->library('security'); <--failing to load this
$this->load->library('tank_auth');
$this->lang->load('tank_auth');
$this->form_validation->CI =& $this;
好像被重定向罚款模块但它与一个错误说::
一个错误时遇到出现
无法加载请求等级:安全
我在做什么错?是否有任何人使用HMVC和坦克认证作为模块进行工作CI安装,以便我可以看到它是如何完成的?我是HMVC的新手,谢谢
库文件夹中是否存在security.php文件? – Tobias
security.php是codeigniter本身的一部分,因此它不在modules/auth/libraries/...文件夹中。为了在模块控制器的构造函数中调用它的库/帮助器,我必须抓住CI的实例吗? –
所以我改变了$ this-> load-> library('security');到$ this-> load-> helper('security');现在发生了一个新的错误,我想当它尝试加载tank_auth库时,说没有找到配置文件tank_auth.php ..尽管module/modulename/config/tank_auth.php完好无损。不知道为什么它找到它,但我假设它似乎是我的其他问题 –