繁体   English   中英

joomla获取帖子数据

[英]joomla get post data

我正在创建joomla组件,并且无法访问帖子中的数据

在一个视图中,我有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">

第一个是我要处理的字段,第二个是通过使用JTable类处理的

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

$ sth为空

我应该在哪里使用JRequest获得该值和其他2

JRequest在2.5中已弃用。

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

$sth ,因为没有可变就像是空team1_goals_players在form.You必须尝试像这个-第一个GET jform ,然后读取team1_goals_players从jform。

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

有关JRequest的更多信息。

暂无
暂无

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

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