This method works in
precisely the same way as the folders() method described above.
The last method that we will investigate is the listFolderTree() method. This
method returns an array of associative arrays that model the structure of an area in
the file system. This example gets an array that describes the frontend root folder of
the current component:
$structure = JFolder::listFolderTree(JPATH_COMPONENT, '.');
The first parameter is the folder in which to start, the second parameter is the RE
filter that the name of the folders must match.
The returned array, for the component com_mycomponent, may look like this:
Array
(
[0] => Array
Chapter 12
[ 351 ]
(
[id] => 1
[parent] => 0
[name] => files
[fullname] => /var/www/html/joomla/components/
com_mycomponent/views
[relname] => /components/com_mycomponent/views
)
)
Additional parameters include the maximum recursive depth, which by default is 3,
the current depth, and the parent ID. We don't normally use the last two parameters;
these are intended for internal use when the method calls itself recursively.
Pages:
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488