简体   繁体   English

joomla获取帖子数据

[英]joomla get post data

I'm creating joomla component and i have problem with accesing data from post 我正在创建joomla组件,并且无法访问帖子中的数据

in one view i have 6 inboxes 3 of them are chandled by JTable class and thats good, but other 3 i want to process, my fields: 在一个视图中,我有6个收件箱,其中3个是由JTable类处理的,这很好,但是其他3个我要处理的字段是:

<input id="jform[team1_goals_players]" class="" type="hidden" name="jform[team1_goals_players]" value="2,2," aria-invalid="false">
<input id="jform_team1_goals" class="required" type="text" value="4" name="jform[team1_goals]" aria-required="true" required="required" aria-invalid="false">

first one is field that i want to process and second is chandled by JTable class by using 第一个是我要处理的字段,第二个是通过使用JTable类处理的

$sth = JRequest::get('team1_goals_players');

$sth is empty $ sth为空

where i should use JRequest to get that value and other 2 我应该在哪里使用JRequest获得该值和其他2

JRequest is deprecated in 2.5. JRequest在2.5中已弃用。

$jinput = JFactory::getApplication()->input;
$post = $jinput->get('jform', array(), 'array');
$sth = $post['team1_goals_players'];

$sth is empty because there is no variable like team1_goals_players in the form.You must try like this- first get jform and then read team1_goals_players from jform. $sth ,因为没有可变就像是空team1_goals_players在form.You必须尝试像这个-第一个GET jform ,然后读取team1_goals_players从jform。

$post = JRequest::get('jform');
$sth = $post['team1_goals_players'];

More about JRequest . 有关JRequest的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM