references:joomla.framework:filesystem:jfolder-listfoldertreeTable of Contents
listFolderTree
Lists folders in a format suitable for tree display. An array containing the folders is returned with appropriate information to relate the various folders in a tree structure. Syntaxvoid listFolderTree ( $path, $filter, $maxLevel, $level, $parent )
ExamplesExample jimport( 'joomla.filesystem.folder' ); $folders = JFolder::listFolderTree( 'plugins/', '.' ); print_r( $folders ); might produce: Result Array ( [0] => Array ( [id] => 1 [parent] => 0 [name] => authentication [fullname] => plugins\authentication [relname] => plugins\authentication ) [1] => Array ( [id] => 2 [parent] => 0 [name] => content [fullname] => plugins\content [relname] => plugins\content ) [2] => Array ( [id] => 3 [parent] => 0 [name] => editors [fullname] => plugins\editors [relname] => plugins\editors ) [3] => Array ( [id] => 4 [parent] => 3 [name] => tinymce [fullname] => plugins\editors\tinymce [relname] => plugins\editors\tinymce ) [4] => Array ( [id] => 5 [parent] => 4 [name] => jscripts [fullname] => plugins\editors\tinymce\jscripts [relname] => plugins\editors\tinymce\jscripts ) [5] => Array ( [id] => 6 [parent] => 3 [name] => xstandard [fullname] => plugins\editors\xstandard [relname] => plugins\editors\xstandard ) ) Discussion |


