How to Access Joomla! Base URI?

This is a quick tip about Joomla! development. Sometimes you, as a Joomla! developer need to create a link to the Joomla! base or somewhere else in Joomla! websites. If everything is stable and won’t change in the future, you can create an static link like http://site.com/components/com_content/views. But the more clever and predicting way to link to somewhere in Joomla! is using base uri as the starting point of the path. In this case we redo the link above like below:


JURI::root().’components/com_content/views

As you see, the key of this subject is JURI::root(). It’s in PHP programming language and you can use it in your template/extension PHP files. The way you can use it is clearly described below.

This link is written in PHP so you can use it in your HTML code like this:

3D Web Development Services

Check Out Our 3D Web Development Projects

We have done a lot of 3D website, 3D game, and Metaverse development projects for our clients. Check them out and enjoy!

Arashtad Services
Drop us a message and tell us about your ideas.
Request a Quote
ThreeJS Development
https://blog.arashtad.com/cms/joomla/jooml-base-url/?feed_id=983&_unique_id=65cd98110e3a6

Comments

Popular posts from this blog

Socket Programming in C TCP Client and Server

How to make a skybox in Three.js: A perfect guide

Why Smart Contracts Are Revolutionary? (Smart Contracts Use Cases)