如何在一个包中安装组件和路由插件? [英] 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?
先谢谢你!沃捷
推荐答案
当 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屋!