How to install component and route plugin in one package?

前端 未结 2 790
天命终不由人
天命终不由人 2020-12-21 15:37

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 hav

2条回答
  •  忘掉有多难
    2020-12-21 16:19

    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

    $installer =  new JInstaller();
    // Install the packages
    $installer->install($pluginPath);
    

    For example

    1. in you xml file install.mycomponent.php
    2. and in install.mycomponent.php there should be a function com_mycomponent_install()
    3. this function will contain the code as

      $installer = new JInstaller(); // Install the packages $installer->install($pluginPath);

提交回复
热议问题