Search code examples
joomlanotifications

How to push notification to Joomla plugin


I want to push some POST data to my plugin in Joomla. But I don't know how to receive the data in my plugin.

Do I have to POST them to some kind of URL as index.php?option=task=pluginnotification&no_html=1 ? Any help?


Solution

  • Only components are supposed to handle URLs directly. There is exactly one component per page which is responsible for handling incoming data. So in general, you can't send data to a plugin.

    But of course, there are workarounds. Given the fact that the component which is addressed by the POST target URL ignores your data, you can access that data in your plugin code. If you want to handle the data earlier, create an additional system plugin which runs before the rendering process.

    The best solution is definitely creating a dedicated component which handles the incoming data and responds in the right way.