我回到了這段代碼,並再次嘗試,但給了我一些錯誤,所以我根據之前回答的這個新的回答(部分工作在Joomla!3.4.5上)
// build the JInput object
$jinput = JFactory::getApplication()->input;
// retrieve the array of values from the request (stored in the application environment) to form the query
$uriQuery = $jinput->getArray();
// build the the query as a string
echo 'index.php?' . JUri::buildQuery($uriQuery);
的Joomla! API文檔:JInput
- JUri
以前的答案: 周圍的Googling I found this:
<?php
// "unparse" the Joomla SEF url to get the internal joomla URL
JURI::current();// It's very strange, but without this line at least Joomla 3 fails to fulfill the task
$router =& JSite::getRouter();// get router
$query = $router->parse(JURI::getInstance()); // Get the real joomla query as an array - parse current joomla link
$url = 'index.php?'.JURI::getInstance()->buildQuery($query);
?>
我與Joomla測試吧! 3.4.4及其工作正常!不知道它是否可以使用1.5
難道你不是指`$ _SERVER ['REQUEST_URI']`? – Gumbo 2009-09-28 08:28:51