我做了一个自定义助手扩展系统string_helper.php。
I made a custom helper extending the system string_helper.php.
我把它放在我的 / application / helpers 目录,根据需要调用 MY_string_helper.php 单元测试其函数。
I placed it in my /application/helpers directory, called it MY_string_helper.php as required, unit-tested its functions.
尝试从模型调用其中一个函数,它不工作。
Now, when I try to call one of its functions from a model, it does not work.
默认字符串帮助中的函数,而不是工作。
The functions in the default string helper work, instead. It looks like my extension is not loaded for some reasons.
非常感谢和节日快乐。
编辑:甚至更有趣。我在 system / helpers 目录中将文件保存为 categories_helper.php ,当我尝试将其加载到模型我得到以下响应:*无法加载请求的文件:helpers / categories_helper.php *
even funnier. I saved the file as categories_helper.php in the system/helpers directory, and when I try to load it within a model i got the following response: *Unable to load the requested file: helpers/categories_helper.php*
推荐答案问题。我来自windows操作系统开发我的codeigniter项目,然后转移到Ubuntu,但不知何故,它仍然没有加载我的助手。
I had the same problem. I came from windows OS development of my codeigniter project, then shifted to Ubuntu, but somehow it still didn't load my helpers.
我发现,改变命名约定小写解决了这个问题。不要遵循在文档中写入的内容,其中给出了要插入的前缀,特别是如果大写。使用小写。
I found that changing the naming convention to lowercase solves the problem. Don't follow what's written in the doc where you are given a prefix to insert, especially if it's in uppercase. Make use of lowercase.
更多推荐
Codeigniter:用户定义的辅助函数不加载
发布评论