如何从 PyroCMS 中的共享插件模块加载共享插件中的库?

发布于 2024-12-02 13:20:01 字数 449 浏览 1 评论 0原文

我正在 ./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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人海汹涌 2024-12-09 13:20:01

我去了 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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文