通过 Joomla 中的 JInput 获取动态帖子字段/数据 [英] Get Dynamic Post Fields/Data via JInput in Joomla

查看:12
本文介绍了通过 Joomla 中的 JInput 获取动态帖子字段/数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上正如问题所描述的那样,我需要在 Joomla 2.5/3.xx 中获取POST"数据,并且我希望通过 JInput(镇上的新话题)获得它.

Basically as the question describes, I need to get "POST" data in Joomla 2.5/3.xx and I want it through the JInput (the new talk of the town).

现在一切都很好,直到我的进一步要求需要这些字段/数据是动态的,即.它(字段)旨在根据情况而改变,我无法知道这些字段将是什么,我知道如何在核心 php 中执行此操作,但 JInput 并非如此,仅此而已,如何我做吗...

Now everything is fine and dandy, until my further requirements needs those fields/data to be dynamic, ie. It(the fields) is designed to change depending on circumstances,there's no way for me to know what the fields are gonna be, I know how to do it in core php, but that's not the case with JInput, so thats it, how do I do it...

推荐答案

好吧,我知道这已经有一段时间了,但我今天遇到了这个问题,并为 POST 表格.

Well I know this has been some time since this was asked, but I came across the issue today and found a Joomla solution for POST forms.

$input = JFactory::getApplication()->input;
$fieldname = $input->post->get('fieldname');

这与使用 $fieldname = $_POST['fieldname']; 本质上是一样的,只是您可以获得留在 Joomla 的 API 中的额外好处.

This is essentially the same as using $fieldname = $_POST['fieldname']; except you get the added benefit of staying within Joomla's API.

这篇关于通过 Joomla 中的 JInput 获取动态帖子字段/数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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