如何将组件和路由插件安装在一个包中?
我为 Joomla 1.5 创建了自定义组件和路由插件,为我的组件以及不与菜单绑定的文章和类别提供 SEO URL。现在我必须分别安装我的组件和路由插件。请问有没有办法将两者安装在一个包中?
先感谢您!沃伊泰克
I have created custom component and a route plugin for Joomla 1.5 to to provide SEO URLs for my component and also articles and categories which are not menu tied. Now I have to install my component and route plugin separately. Is there a way to install both in one package please?
Thank you in advance! Vojtech
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个更简单的方法。
什么是包?
包是一种扩展,用于一次性安装多个扩展。
如何创建包?
包扩展是通过将扩展的所有 zip 文件与 xml 清单文件压缩在一起来创建的。例如,如果您有一个由以下内容组成的包:
该包在您的 zip 文件中应具有以下树:
pkg_helloworld.xml 可能具有以下内容:
There is a easier method.
What is a package?
A package is a extension that is used to install multiple extensions in one go.
How do I create a package?
A package extension is created by zipping all zip files of the extensions together with a xml manifest file. For example if you have a package composed by:
The package should have the following tree in your zipfile:
The pkg_helloworld.xml could have the following contents:
当安装的任何扩展程序时,Joomla 都会向您的安装文件触发事件“com_yourcomponent_install()”,您已在 xml 文件中提到过该事件。
编写一个函数 com_yourcomponent_install 在其中获取插件文件夹的路径并安装它
例如
这个函数将包含代码作为
$installer = new JInstaller();
// 安装包
$installer->install($pluginPath);
When any extension installed Joomla triggers an event 'com_yourcomponent_install()' to your install file, which you have mentioned in xml file.
write a function com_yourcomponent_install in which get the path of plugin folder and install it
For example
this function will contain the code as
$installer = new JInstaller();
// Install the packages
$installer->install($pluginPath);