i've created an extension plugin and i'am having issue to redirect on the trigger onExtensionBeforeInstall
Here is my code :
class plgExtensionExample extends JPlugin{
function onExtensionBeforeInstall($method, $type, $manifest, $eid){
$app = JFactory::getApplication();
$app->redirect(JRoute::_('index.php'));
$app->close();
}
}
When i try to install a plugin a have a javascript error :
In chrome
Uncaught TypeError: Cannot read property 'redirect' of undefined
In firefox
TypeError: res.data is undefined
I've searched in joomla and res
is the result of a call in ajax, but res
need to be an object and it's a string of html.
I've tried to reach the url which is called in ajax but i got this message :
The most recent request was denied because it contained an invalid security token. Please refresh the page and try again.
Thanks for your answers.