2

I've got a plugin that's a package with 4-5 sub-packages. When the package completes installation, I would like to direct the user automatically to my options page to configure the plugin. I've hunted around, and I don't see how to do that.

Any help would be appreciated.

2

You can use the postflight method in your install script for this, like so:

class Com_MyComponentInstallerScript
{
    protected $extension = 'com_mycomponent';

    public function postflight($type, $parent)
    {
        JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_config&view=component&component=' . $this->extension));
    }
}
  • The one thing that's required is that for this to work, you must specify false as the second argument to the JRoute::_() call. Otherwise the ampersands are encoded, breaking the redirect. – George Sexton Feb 6 '17 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.