在joomla模块后端页面中运行自定义php代码 [英] Run custom php code in joomla module backend page

查看:136
本文介绍了在joomla模块后端页面中运行自定义php代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Joomla 2.5, 我正在开发一个模块.我的模块在前端加载了一些JavaScript.当管理员单击保存"按钮时,我想在后端运行一些php代码.怎么做?

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?

推荐答案

您可以编写一个使用事件触发器onBeforeSave的插件,然后在单击保存按钮时运行该插件. 您可以对邮寄发送的数据进行任何验证,如果验证失败,则返回false,然后返回表格.

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

这篇关于在joomla模块后端页面中运行自定义php代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆