jimport is a function that is used to include Joomla library files.
How to use Jimport:
- Find the path to the library file you want to include.
• In our testing, we want to import /libraries/joomla/filesystem/path.php
• Jimport will only import files found within the libraries folder. Make the following changes to the path:
• Remove /libraries/ from the path
• Remove .php from the path
• Replace slashes with periods in the pathAfter following the steps above, /libraries/joomla/filesystem/path.php will be:
joomla.filesystem.path
Take this new path and pass it to jimport, as in:
jimport(‘joomla.filesystem.path‘);
If you followed along with the above example, you can see in the screenshot below how jimport works: