如何从 PyroCMS 中的共享插件模块加载共享插件中的库?
我正在 ./addons/shared_addons/modules/
目录中创建一个模块。该模块称为render
。
在该模块中,我想访问放入 ./addons/shared_addons/libraries/
目录中的库。该库名为 pchart
如果在模块中我使用 $this->load->library('pchart')
它会失败并提示找不到文件。
我尝试将 pchart
库文件复制到 ./system/cms/libraries/
目录,并且从那里加载正常,因此文件本身没问题。只是没找对地方而已。
默认情况下,它在模块中查找库,但它不在那里。我如何告诉 PyroCMS 在正确的位置查找?
谢谢。
I'm making a module in the ./addons/shared_addons/modules/
directory. The module's called render
.
From within that module I want to access a library that I've put in the ./addons/shared_addons/libraries/
directory. The library's called pchart
If, from the module, I use $this->load->library('pchart')
it fails saying that it can't find the file.
I've tried copying the pchart
library file to the ./system/cms/libraries/
directory, and from there it loads fine, so the file itself is OK. It's just not looking in the right place.
By default it's looking in the module for the library but it's not there. How can I tell PyroCMS to look in the right place?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我去了 PyroCMS 论坛 (http://pyrocms.com/forums/topics/view/5385< /a>)最终找到这一点:
./addons/shared_addons/libraries/
目录用于在该人管理的所有站点之间共享插件PyroCMS 安装。在大多数情况下,只有一个站点,
默认
。为了与整个站点共享插件,./addons/default/
中有一个目录,它是加载器库的第二个调用端口。 (仅次于模块本身)I went to the PyroCMS forums (http://pyrocms.com/forums/topics/view/5385) to find this out in the end:
The
./addons/shared_addons/libraries/
directory is used for sharing addons across all sites being managed by the one PyroCMS install.In most cases there's just one site,
default
. In order to share an addon with the whole site there's a directory at./addons/default/
that is the second port of call for the loader library. (second to the module itself)