如何在一个软件包中安装组件和路由插件? [英] How to install component and route plugin in one package?
问题描述
我为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?
先谢谢您! Vojtech
Thank you in advance! Vojtech
推荐答案
在安装了任何扩展程序后,Joomla都会触发安装文件中的事件"com_yourcomponent_install()",该事件已在xml文件中提到.
When any extension installed Joomla triggers an event 'com_yourcomponent_install()' to your install file, which you have mentioned in xml file.
编写一个函数com_yourcomponent_install,在其中获取插件文件夹的路径并安装
write a function com_yourcomponent_install in which get the path of plugin folder and install it
$installer = new JInstaller();
// Install the packages
$installer->install($pluginPath);
例如
- 您的xml文件install.mycomponent.php
- 在install.mycomponent.php中应该有一个函数com_mycomponent_install()
-
此函数将包含代码为
- in you xml file install.mycomponent.php
- and in install.mycomponent.php there should be a function com_mycomponent_install()
this function will contain the code as
$ installer = new JInstaller(); //安装软件包 $ installer-> install($ pluginPath);
$installer = new JInstaller(); // Install the packages $installer->install($pluginPath);
这篇关于如何在一个软件包中安装组件和路由插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!