问题
i am using Joomla 2.5 , I am working on a module .My module loads some javascripts in frontend. I want to run few php code in backend, when admin click on save button. How to do that?
回答1:
You can write a plugin that uses the event trigger onBeforeSave, then when you hit the save button, the plugin is run. You can do any validation on the data sent by post, if it fails just return false and you will return to your form.
You can see some documentation on how to do this here:
http://docs.joomla.org/Plugin/Events
http://docs.joomla.org/J2.5:Creating_a_Plugin_for_Joomla
来源:https://stackoverflow.com/questions/23266011/run-custom-php-code-in-joomla-module-backend-page