Jordan Weinstein
Jordan Weinstein

Reputation: 43

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:

<?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;
?>

Upvotes: 0

Views: 653

Answers (1)

Jordan Weinstein
Jordan Weinstein

Reputation: 43

Solved.

Change JSite to JApplicationSite

Upvotes: 2

Related Questions