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:
<?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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.