是否可以为 Zend 配置自定义插件目录?
我希望能够将自定义插件存储在应用程序的库文件夹中(目前我将它们存储在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想出了这个:
创建一个文件夹:(
其中 PREFIX 是插件的类前缀,它是根目录)
在 application.ini 文件中 - 添加:
添加此行以向前端控制器注册插件
如果需要/想要组织你的插件文件夹 - 使用 Zend 下划线 = 目录命名约定 - 所以这个:
将引用一个名为:的类:
在目录中名为:“PluginName.php”的文件
中:
希望对需要提出此问题的人有所帮助
I figured this one out:
Create a folder in:
(where PREFIX is the class prefix for your plugin, and it's root directory)
In the application.ini file - add:
add this line to register the plugin with the Front Controller
If you need/want to organise your plugin folders - use the Zend underscore = directories naming convention - so this:
would refer to a class called:
in a file called: "PluginName.php"
in directory:
Hope that helps anyone who needs to ask this question