0

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?

Vlad Davidchenko
  • 454
  • 1
  • 7
  • 24
Dannym
  • 21
  • 6
  • Possible duplicate of [When should I use GET or POST method? What's the difference between them?](https://stackoverflow.com/questions/504947/when-should-i-use-get-or-post-method-whats-the-difference-between-them) – user11222393 Oct 23 '19 at 14:12
  • No, I don't ask about POST/GET but how to receive the data – Dannym Oct 23 '19 at 14:14

2 Answers2

0

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.

Sven Bluege
  • 1,418
  • 1
  • 10
  • 19
0

first way : if you want , you can send data to AJAX plugins. for this way read ajax component in joomla: https://docs.joomla.org/Using_Joomla_Ajax_Interface

secend way : or you can create EVENT for your Component and call this event befor or after save data in this case you access form data before or after save and you can manipulate data

Majid Ahmadi
  • 127
  • 5