[英]Stay at the same page after the form is submitted at the Joomla! back end
我在com_product的admin端的default.php中有一個表單。 問題是,表單在提交后重定向回控制面板。 我需要它留在當前頁面。 表單使用GET方法,作為動作,我嘗試了所有這些:
<form method="get" action="<?php echo $current_url; ?>">
...
$current_url = $_SERVER['QUERY_STRING'] . '&' . $_GET['date_scope']; // Results: administrator/index.php?date_scope=1&submit_range=
並且:
$current_url = $_SERVER['QUERY_STRING']; // Results: administrator/option=com_product&view=reports?date_scope=1&submit_range=
並且:
$current_url = JURI::root() . 'administrator/index.php?option=com_product?' . $_SERVER['QUERY_STRING'] . $_GET['date_scope']; // Results: administrator/index.php?date_scope=1&submit_range=
並且:
$current_url = $_SERVER['REQUEST_URI']; // Results: administrator/index.php?date_scope=1&submit_range=
並且:
$current_url = JURI::root() . 'administrator/index.php?option=com_product'; // Reuslts: administrator/index.php?date_scope=1&submit_range=
並且:
$current_url = JURI::root() . 'administrator/index.php?option=com_product' . $_GET['date_scope']; // Results: administrator/index.php?date_scope=1&submit_range=
知道如何處理,所以它在表單提交后保持在同一頁面?
如果你讓提交通過控制器沒有特殊的重定向,它應該留在那里。 它應該默認為當前視圖。 在模板中使用JHTML::_('behavior.keepalive')
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.