PHP code example of emlynwest / setui

1. Go to this page and download the library: Download emlynwest/setui 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/ */

    

emlynwest / setui example snippets



$config = [
    // This is each leaf of the tree, by default it has a link and a list of children
    'leafView' => 'setui::setui/leaf',
    
    // This is the list of children for each leaf
    'listView' => 'setui::setui/list',
    
    // This is the top level container, it can be used for adding style around the list
    'containerView' => 'setui::setui/container',
    
    // If not set to null will be treated as an instance of Theme for loading views
    'themeInstance' => null,
    
    // Property name of the model to load the leaf name from
    'nameProperty' => 'name',
    
    // Set to true to display the root node of the tree
    '


$menu = new \SetUI\Menu($config);

$set = Model_Tree::forge()->set_tree_id(1)->root()->get_one();

// $tree contains the top level View object
$tree = $menu->build($set);