Hello friends,
Today we will learn how to display all the folder within a folder in Joomla. In Joomla, folders() method is used to list all the folders within a folder. This function return an indexed array of the folders
Syntax:
JFolder::folders($path);
$path is the path of the folder whose directories we need to display.
Let's take an example to understand this. Suppose, we need to display all the directories within a components folder. We will write the following PHP script for the same:
<?php
$path=JPATH_ROOT.'/components/';
print_r(Jfolder::folders($path));
?>
Above code will display all the folders inside component folder in an indexed array form.
0 Comment(s)