简体   繁体   English

在 Joomla 4 中获取非 sef URL

[英]Get non-sef URL in Joomla 4

Can you tell me how to echo the non-sef URL in Joomla 4. The code below and other answers on here work only in Joomla 3:您能告诉我如何在 Joomla 4 中回显非 sef URL。下面的代码和此处的其他答案仅在 Joomla 3 中有效:

<?php
$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);
echo $url;
?>

Solved.解决了。

Change JSite to JApplicationSite将 JSite 更改为 JApplicationSite

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

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