PHP code example of luminee / tree

1. Go to this page and download the library: Download luminee/tree library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

luminee / tree example snippets


$Tree = new Tree();
$Tree->buildTree($array);

$item = $Tree->getTree(); // Get Tree
$item = $Tree->getChildren('group1', 'group') // Find Item and Its Children
$item = $Tree->getParents('group1', 'group') // Find Item and Its Parents

$option = ['parent' => 'pre', 'children' => 'childs', 'parent_id' => 'pid']
// Customize tree keys
$Tree = new Tree($option);