我知道你可能不会有这么多问题.
我正在开发一个组件,希望能够在启用标准电子格式时处理非标准电子格式的URL,无论是内置的标准电子格式还是类似于sh404sef的东西。
确实将原始的非SEF网址存储在任何地方, ie。index.php?com=com_fred&view=homepage?
我发现任何激活的SEF都会将JURI::getInstance()值更改为SEF等价物。我还发现$REQUEST‘’URI‘值并不适用于所有平台/服务器等。
谢谢你的帮助
发布于 2012-10-28 06:32:12
GET/POST请求中的所有vars放入一个数组中。此时,您还可以在生成URL字符串之前修改这些值。
$getVars = JRequest::get( 'GET‘);希望能帮上忙!
发布于 2015-09-24 15:28:58
我回到了这段代码,然后再试一次,但是给了我一些错误,所以我根据我以前用这个新的答案(在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);先前的回答:在我发现了这个周围搜索
<?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
发布于 2012-04-06 17:41:55
您可以使用JRequest:: get (true)从URL获取所有查询参数的数组。不过,我还没有对其进行足够的检查,以了解它是只返回GET参数还是执行所有请求参数(我认为这更有可能)。不过,这可能会对你想要的有所帮助。
https://stackoverflow.com/questions/990202
复制相似问题