运行 php joomla 用户注销前的代码

run php code before joomla users logout

我为 Joomla 编写了一个组件,网站用户可以使用该组件进行预约 我想在用户离开网站时执行 php 代码,这样如果操作不成功,该预订的付款将从数据库中删除。

您应该开发一个用户插件并使用 Joomla 事件在相关事件上触发您的代码。 https://docs.joomla.org/Plugin/Events/User

onUserLogout

This event is triggered before the user is logged out of the system.

If any plugin returns false, the global logout fails and the onUserLogoutFailure event is fired; if it succeeds, onUserAfterLogout event is triggered instead.

您还可以在此处找到有关开发插件的完整教程:https://docs.joomla.org/J3.x:Creating_a_Plugin_for_Joomla