Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1470

General Questions/New to Joomla! 5.x • From JRoute to Route?

$
0
0
I was told JRoute was going to be phased out and no longer work on future versions of Joomla. The following code work(ed) well and gave me the output url I wanted:

Code:

JRoute::_('index.php?option=com_content&view=category&id=9')
So after some trial and error I tried getting the same result with the new way of doing it, see below:

Code:

Route::_(RouteHelper::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language) . "&view=category&id=9");
I just wanted to know if this is the proper way of doing it. The result is what I want, but it might be it's still not done in a best-practice way. Any feedback would be most appreciated.

(to frame it in the right context, I want to add an url in my override template for Article, and have it take the user to the category of said id)

Statistics: Posted by SocketPup — Sat May 04, 2024 6:04 am



Viewing all articles
Browse latest Browse all 1470

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>