SUIT Framework

Scripting Using Integrated Templates

Docs - treeappend

07/31/2010: SUIT 2.0.1 and Rulebox 1.1.0 released.

Available Since: SUIT (2.0.0)

Add to the tree contents in the appropriate place if necessary.

Syntax list suit.treeappend ( mixed append, list tree )
Parameters
append

The items to add.

config

The contents of the tree to add the item on.

Return Value

The updated tree contents.

Examples
Basic Usage
PHP
<?php
require 'suit.class.php';
$suit = new SUIT();
$tree = array
(
    array
    (
        'contents' => array(),
        'rule' => '[var]'
    )
);
$tree = $suit->treeappend(array('Test'), $tree);
/*
Result: array
(
    array
    (
        'rule' => '[var]',
        'contents' => array('Test')
    )
)
*/
?>
Python
import suit
tree = [
    {
        'contents': [],
        'rule': '[var]'
    }
]
tree = suit.treeappend(['Test'], tree)
# Result: [
#     {
#         'rule': '[var]',
#         'contents': ['Test']
#     }
# ]
See Also