Couldn`t connect to helper in Codeigniter

吃可爱长大的小学妹 提交于 2019-12-25 00:40:27

问题


Trying add default helper in Codeigniter, type in autoload $autoload['helper'] = array('url'); But i have an error Unable to load the requested file: helpers/_helper.php on my system/helpers folder there is no such file like _helper.php what i shoul do to load it?


回答1:


Check whether you have an empty array set to $autoload['helper'] variable in application/config/autoload.php.

$autoload['helper'] = array(''); // throw an error stated

Replace it with

$autoload['helper'] = array();

Even though I do not understand why it has to behave differently from the above two assignments, basically IMO it should behave the same.




回答2:


Make sure you write 'url'

Like this: $autoload['helper'] = array('url');




回答3:


make sure the array is empty if your not going to pass in a url and if so this would ideal in passing in css stylesheet urls.



来源:https://stackoverflow.com/questions/9484480/couldnt-connect-to-helper-in-codeigniter

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