[英]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.