是否可以为 Zend 配置自定义插件目录?

发布于 2024-08-17 21:10:59 字数 89 浏览 1 评论 0原文

我希望能够将自定义插件存储在应用程序的库文件夹中(目前我将它们存储在 Zend 库本身中)。有没有办法在 application.ini 文件中提供额外的插件目录?

I want to be able to store custom plugins in the library folder of my application (currently I am storing them in the Zend library itself). Is there a way of providing additional plugin directories in the application.ini file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

美男兮 2024-08-24 21:10:59

我想出了这个:

创建一个文件夹:(

 application/library/PREFIX

其中 PREFIX 是插件的类前缀,它是根目录)

在 application.ini 文件中 - 添加:

 autoloaderNamespaces[] = "PREFIX"

添加此行以向前端控制器注册插件

 resources.frontController.plugins.PluginName= "PREFIX_PluginName"

如果需要/想要组织你的插件文件夹 - 使用 Zend 下划线 = 目录命名约定 - 所以这个:

resources.frontController.plugins.PluginName= "PREFIX_Path_To_Folder_PluginName"

将引用一个名为:的类:

PREFIX_Path_To_Folder_PluginName 

在目录中名为:“PluginName.php”的文件

中:

application/library/PREFIX/Path/To/Folder/PluginName.php

希望对需要提出此问题的人有所帮助

I figured this one out:

Create a folder in:

 application/library/PREFIX

(where PREFIX is the class prefix for your plugin, and it's root directory)

In the application.ini file - add:

 autoloaderNamespaces[] = "PREFIX"

add this line to register the plugin with the Front Controller

 resources.frontController.plugins.PluginName= "PREFIX_PluginName"

If you need/want to organise your plugin folders - use the Zend underscore = directories naming convention - so this:

resources.frontController.plugins.PluginName= "PREFIX_Path_To_Folder_PluginName"

would refer to a class called:

PREFIX_Path_To_Folder_PluginName 

in a file called: "PluginName.php"

in directory:

application/library/PREFIX/Path/To/Folder/PluginName.php

Hope that helps anyone who needs to ask this question

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